Moving YTD MAX by group in Visual expression builder (data flow in ADF) - expression

I am new to visual expression builder language in ADF. I am not sure if I can calculate the moving YTD MAX (or average) by group for the following case in expression language:
I have sales data for different products in different periods, and I want to know the moving YTD (year to date) max sales amount by product.
I appreciate any help.

You can use Window transformation in Data Flow.
My test:
Data of my source
2.Setting of Window transformation
Data preview of Window transformation

Related

DAX ignore row context in measure. Calculate for a defined set of dates and show the value for all dates in visual

I am trying to create a measure which calculates the average daily revenue per customer, but only using days in a 6 months period prior to a specific date (where some type of conversion happens).
This specific date can be different for each customer.
The intention is to use the measure as a baseline for indexing daily average in the days/months/years after said conversion date.
If I put my current version of the measure in a card it works just fine (circled in green). But I will eventually have to visualize this over time as well. Thus I need the value to stay the same regardless of the row/date context in a table or timeline (circled in orange).
I suspect I need to use one of the ALL/ALLSELECTED/ALLEXCEPT filter modifiers but I can't really get anything to work.
The measure looks like this for now:
Average daily rev before conversion = CALCULATE (
AVERAGEX(
VALUES('Date'[Date]),
[HI & Acc Rev]
),
FILTER('poc vFact_SalesLine','poc vFact_SalesLine'[OrderDate_ID] IN DATESINPERIOD('Date'[Date],FIRSTNONBLANK('poc vDim_Customer'[DSE first conversion date],1),-6,MONTH)))
I've tried adding REMOVEFILTERS('Date'[Date]) just before the filtering of order dates, but that doesn't work. Gives me the exact same values as shown below.
All help is very welcome? Is my approach all wrong?

Is it possible to use a dynamic value in a DAX formula?

I'm working on a BI project with Visual Studio and Power BI.
I get the sales of several stores and in Visual Studio I made a column calculated with the following formula :
=
SWITCH (
TRUE(),
Y2_Sales' [storename] = "UK-RC O/O NEWQUAY", Y2_Sales [SalesExGST] / 0.8564058469475494,
'Y2_Sales' [SalesExGST]
)
To explain I get the sales in GBP and as soon as the store is Newquay I convert these values into euros to display them in my Power BI report.
The problem is that the value I put in hard is a value that moves every week, you can find it here :
https://www.xe.com/fr/currencycharts/?from=EUR&to=GBP&view=1D
Is it possible to modify this value dynamically by having historical exchange rates?
I don't quite understand why you want a calculated column, wouldn't a measure for euros be easier? Then you could declare your change rate as another measure and make the whole thing dynamic. You may need to use a disconnected table and selected measures to get the result you want, have a look at sumproduct for that https://www.sumproduct.com/blog/article/power-pivot-principles/ppp-variables-and-disconnected-tables-in-power-bi it looks like you're most of the way there, just lose the calculated column and go all measure!

Columnar report in Tableau

I'm new to Tableau. I'm using Tableau Desktop Professional 10.0.15. I need to write a very simple report that does not use any visualization.
Here's a example of the layout (the numbers are made up):
Web Site 1 North America Europe
Total Hits 3,523,483 3,523,483
Sessions 1,248,234 1,248,234
Unique Visitors 1,809,392 1,809,392
New Visitors 383,932 383,932
% new 10.9% 10.9%
Avg Page Views per user 1.9 1.9
Web Site 2 North America Europe
Total Hits 3,523,483 3,523,483
Sessions 1,248,234 1,248,234
Unique Visitors 1,809,392 1,809,392
New Visitors 383,932 383,932
% new 10.9% 10.9%
Avg Page Views per user 1.9 1.9
The users want the measures to be in one column, but they're not the same measures. Some measures need to be formatted as percentages. The average should have 1 decimal place. I have a feeling it's not possible to format the same measure differently in Tableau. Ideally, there would be something like a banded report where I could stack the measures on top of each other. But, I don't see a way to do that in Tableau. I could create a table in my database and put the measures in the same field and add the formatting in the database (which feels wrong), but it would have to be text (to have '%'). But, Tableau won't treat a text field as a measure. Also, it seems like if you don't add a measure, Tableau will insert a fake measure and put 'Abc' as the value (at least, I think that's why I'm getting these 'Abc' columns in my reports that I didn't add and that aren't in my data).
It seems like Tableau wants you to do something like this:
Unfortunately, this is not what my users want. Any suggestions?
In Tableau it's possible to put many measures in a single column using the measure names in rows.
To do this, add to filters shelf the dimension called Measures Names (the last one). Select all the Measures you'd like to show (Hits, Sessions, Visitors, Views, etc.). Then, drag this dimension to the rows shelft. Next, drag the measure called Measures Values (the last one too) to the marks shelf, specifically in the text box. You can also add other dimension to rows shelft (like website) to the left of Measures Names. This will show a table similar to your requirement.
By default, the Measure Values are SUM of each measure. Just right click on them and select the aggregation you need (AVG, COUNT or other).
Finally, you can format each measure as you want, right click a measure value, and select Format...

SSRS 2012 total of a percentage measure

I have a percentage measure calculated in SSAS tabular and its correct.
But when i use it in a report i face the following problem (in all percentage measures).
the values under male and female (which are subgroup of saudi and non-saudi) are correct but if you look at the total under "Both sexes" it is incorrect,because it shows summation of male and female percentage, where the right thing is it shows the percentage of the saudi or non-saudi.
If i calculate the measure in SSRS in the expression fields i get it right as follows
But i want to use the measure to show the right values.
So.. can anyone help me with this i have serious issues in later reports and i just cant simply recalculate the SSAS measures in SSRS using expressions.
Note: dont mind the decimal places differences between the two pics.
Thank you.
You can change your MDX query in SSRS to return the subtotal rows then change your Textbox formulas in the body of the Report to say =Aggregate instead of =Sum. This process is described more here by Stacia. You can use manual MDX queries. Don't miss the comment at the bottom:
Romuald Coutaud March 17, 2011 at 7:52 pm Hi Stacia,
In fact, it works in query mode too in 2008R2. But, I have to admit
that the way that RS and AS work together when you want to use
aggregate function is very difficult to perfectly understand and I
have struggle very long time to make one sample report running in this
way. In query mode you need to write MDX by referencing each level of
the hierarchies from the top one to the deepest one want to display in
your report, even you don’t need to use all these ones. As an example
you have to put Year, Quarter and Month to be sure to display Month
and be able to use aggregate function.
Basically in your report =Aggregate will try to retrieve a row where Nationality is not null and Gender is null. If you get stuck please write back with the list of each field used in each group in SSRS and a screenshot of the MDX query designer.

Business Objects XI Web Intelligence Aggregation Issue (11.5.8.897)

I've got a multiple tabbed report. On one tab I have the details listed and on another I have a summary table (cross reference) type of aggregation based on the same dimensions utilized in the detail report. I've created a calculated field that takes the product of two measures, I've saved this as a variable. When I try to aggregate that variable on the summary report BOWI is not calculating correctly. Example:
QTY * PRICE = LineTotal
2 * 3 = 6
4 * 3 = 12
TotalOrder = $18
Calculates correctly on the detail report.
When I put this on the aggregate report it is doing the following:
Sum QTY * Sum Price = Total, in other words it is doing
6 * 6 = $36.
My totals on the aggregate are highly inflated. Firstly in what world does that order of precedence make sense? and secondly how can I tell BOWI to sum the TotalOrders instead of breaking it back up into it's components summing those and then multiplying?
Is it a bug?
Further Information
The detail report is Sectioned by Year, Region, State -> Detail lines
The summary report is dimensioned by Year, Region, State
The (QTY * PRICE) component is saved as a variable and utilized in both places.
Am I missing the secret handshake somewhere when calculated fields/variables can't be aggregated and they need to do so in the Universe?
I havent worked with WEBI for a while, I mainly develop DESKI reports, however what you describe sounds similar to the aggregation that occurs in DESKI. If a measure is set to sum aggregation, then it will add all the measures together that relate to the dimension that is added to the report.
For example, if like my details reports, you have the columns order number, qty, price then the aggregation will sum both qty and price at the order level, which is correct. However moving to the summary table then this will cause incorrect data.
To remove the aggregation you can change it from SUM to NONE, I cant recall off the top of my head on how to do this in WEBI (if you cant find out I can check my course materials which are work).
Alternatively, it is best to ensure the dimensions on your summary report are suitable for the data presented.
If you need any further information please let me know.
Matt

Resources