The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
I've created a YTD measure in a matrix and I'd like to show a subtotal summing years by category. The problem I'm facing is that the subtotal shows just the last year and does not aggregate the years.
Anyone has ideas about how to fix it?
Thanks in advance,
Angelo
Solved! Go to Solution.
The TOTALYTD function works in the year context only. Thus I created a custom mesaure has suggested in this post:
https://community.powerbi.com/t5/Desktop/Cumulative-Running-Totals-in-DAX/m-p/42608
Cumulative Value =
IF(
MIN(Dim_Calendar[Date])<=CALCULATE(
MAX(Dim_Calendar[Date]);
ALL(TF));
CALCULATE([Valore_M];
FILTER(All(Dim_Calendar[Month]);Dim_Calendar[Month]<=MAX((Dim_Calendar[Month]
))));BLANK())
Now it works!
Hi @angelocecinati,
Please try this:
ValueYTD = SUMX ( sales_table, TOTALYTD ( [Value_M], 'Dim_Calendar'[Date] ) )
Best regards,
Yuliana Gu
The TOTALYTD function works in the year context only. Thus I created a custom mesaure has suggested in this post:
https://community.powerbi.com/t5/Desktop/Cumulative-Running-Totals-in-DAX/m-p/42608
Cumulative Value =
IF(
MIN(Dim_Calendar[Date])<=CALCULATE(
MAX(Dim_Calendar[Date]);
ALL(TF));
CALCULATE([Valore_M];
FILTER(All(Dim_Calendar[Month]);Dim_Calendar[Month]<=MAX((Dim_Calendar[Month]
))));BLANK())
Now it works!
Hi Yuliana,
Thanks for your reply. This solution makes the subtotal works properly. Unfortunatly the YTD measure does not work over the months, cause it should sum the passed period values. .
I think that if I put the sumx function in front of the measure it computes the YTD for the single row of the fact table.
If I change the order of the matrix it works!
Do I have to change the model behind?
Thanks again,
Angelo
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
80 | |
71 | |
51 | |
50 |
User | Count |
---|---|
128 | |
122 | |
77 | |
64 | |
60 |