Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
I have an issue with the Rolling total from last year vs this year. I need to create a measure that calculates the following:
YTD Shipments / (LastYear(YTD shipments)/LastYear(Shipments)
This is being of an issue, mainly because the date of the data is the first Monday of each week, that means I have data from week to week. That is messing up when I use Dateadd functions.
The YearToDate calculations are working fine the problem is last year running total. The important thing is no just the total index (formula above) but that it can be display and filter in a table or other visuals.
Here is what I have done so far:
ShipmentsLYTD = IF ( HASONEVALUE ( 'TableShipments'[Time] ), CALCULATE ( SUM ( 'TableShipment'[Shipments] ), SAMEPERIODLASTYEAR ( 'TableShipment'[Time] ) ), SUMX ( SUMMARIZE ( 'TableShipment', 'TableShipment'[Time], 'TableShipment'[Country], "LYTD", CALCULATE ( SUM ( 'TableShipment'[Shipments] ), SAMEPERIODLASTYEAR ( DATESYTD ( 'TableShipment'[Time] ) ) ) ), [LYTD] ) )
For the Last Year calculation I have:
TransLY = IF(HASONEVALUE('TableShipments'[Time]), CALCULATE( SUM('TableShipments'[Shipments]), PREVIOUSYEAR('TableShipments'[Time]) ), CALCULATE( SUM('TableShipments'[Shipments]), 'TableShipments'[LY] = TRUE() ) )
(updated) The LY calculation is like this:
LY = If(YEAR('TableShipments'[Time]) = YEAR(MAX('TableShipments'[Time]))-1,TRUE())
What I expect is something like the index in the last part of the screenshot.
The data is something like this
Thanks in advance.
FYI: @thschr
@Jmenas ,
YTD Shipments / (LastYear(YTD shipments)/LastYear(Shipments)
Could you explain more about the three columns/measures above? In addtion, in the Last Year calculation you provided, you use
'TableShipments'[LY] = TRUE()
But where is the column [LY] in the sample data? Could you also share the expected result for further analysis?
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-yuta-msft ,
Thanks, I updated the task with what you mentioned.
Let me know you need more info.
Best,
J.
User | Count |
---|---|
87 | |
72 | |
68 | |
63 | |
54 |
User | Count |
---|---|
98 | |
89 | |
74 | |
67 | |
62 |