Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello All,
I have a table which has the data till Sept which is the maximum month . i have a date column first of everymonth in the Table.I want to have the YTD value till prevoius month of maximum month
How to calculate the sum?
Thank you in advance
I got lot of support form you guys.
Solved! Go to Solution.
Hi @unknown_anony ,
Please have a try.
YTD Sales =
VAR MaxMonth = MAX(Orders[Order_Date].[MonthNo])
VAR PrevMonth = MaxMonth - 1
RETURN
TOTALYTD(SUM(Orders[Sales]), Orders[Order_Date], Orders[Order_Date].[MonthNo] <= PrevMonth)
TOTALYTD function (DAX) - DAX | Microsoft Learn
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @unknown_anony ,
Please have a try.
YTD Sales =
VAR MaxMonth = MAX(Orders[Order_Date].[MonthNo])
VAR PrevMonth = MaxMonth - 1
RETURN
TOTALYTD(SUM(Orders[Sales]), Orders[Order_Date], Orders[Order_Date].[MonthNo] <= PrevMonth)
TOTALYTD function (DAX) - DAX | Microsoft Learn
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Can you please share your demo input and expected output!
Thankn you @v-rongtiep-msft .
The above solution worked fine @Ahmedx . Thank you
User | Count |
---|---|
100 | |
89 | |
82 | |
76 | |
71 |
User | Count |
---|---|
113 | |
104 | |
100 | |
73 | |
65 |