Skip to content

Instantly share code, notes, and snippets.

async testFunction(payload) {
try {
const response = await this.$axios.put("url/to/update/resoure", payload);
// At this point, the response is the updated resoure
// as all the polling has been taken care of
alert(response);
export default function ({ $axios }) {
// Axios interceptor to handle responses that need to be polled
$axios.onResponse(async response => {
// Use the 202 response code as an indicator that polling is needed
if (response.status === 202) {
console.log("HTTP 202 received, polling operation...");
console.log("Operation running at " + response.headers.location);
EVALUATE(
SUMMARIZECOLUMNS (
'Date'[Day],
FILTER(Date, 'Date'[Year] = 2020),
"Order count", 'Measures'[CountOfOrders],
"Total amount", 'Measures'[TotalAmount],
)
)
Feature: Weekly sales
In order understand if we're meeting our sales targets
As a sales manager
I need to see weekly sales figures for the year to date
Background:
Given I am logged in as 'Sales Manager'
And I am viewing the 'Weekly Sales' report
And there is the following 'Orders' data:
| OrderId | CustomerId | OrderDate | TotalAmount |
Feature: Orders entity
In order build reports that contain data about Orders
As a report designer
I want the Orders entity to be present in a dataflow
Background:
Given I have a dataflow called 'Sales Dataflow'
Scenario: Valdiate Orders entity schema
When I query the dataflow definition
using Microsoft.AnalysisServices.Tabular;
public async Task AddOrUpdateCalculatedColumnAsync(string tableName, string columnName, string expression)
{
using (var server = new Server())
{
server.Connect(this.GetConnectionString(await this.GetTokenAsync()));
var db = server.Databases[this.modelName];
var model = db.Model;
public async Task<string> GetRefreshStatus(string id)
{
var client = await this.AuthenticateAndUseHttpClient();
var response = await client.GetAsync($"refreshes/{id}");
response.EnsureSuccessStatusCode();
var content = await response.Content.ReadAsStringAsync();
public async Task<string> RefreshModelAsync()
{
var client = await this.AuthenticateAndUseHttpClient();
// Hard coded to sensible defaults, but could be parameterised
var jsonBody = @"{""Type"": ""Automatic"",""CommitMode"": ""default"",""MaxParallelism"": 10}";
var content = new StringContent(jsonBody, Encoding.UTF8, "application/json");
var response = await client.PostAsync("refreshes", content);
using Microsoft.AnalysisServices.AdomdClient;
public async Task<List<string>> GetMeasuresAsync()
{
var measureNames = new List<string>();
using (var connection = new AdomdConnection(this.GetConnectionString(await this.GetTokenAsync())))
{
connection.Open();
public async void CalcualteTotalSalesByCategory(int year)
{
string query = $@"EVALUATE(
SUMMARIZECOLUMNS(
'DimProducts'[Category],
FILTER(DimDate, DimDate[Year] = {year}),
""Total Sales"", [TotalSales]
)
)";