The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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
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 June 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
102 | |
82 | |
62 | |
55 |
User | Count |
---|---|
253 | |
119 | |
115 | |
95 | |
70 |