March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a sales data for the last 3 years. In my dashboard i have month and year slicer. I placed two cards one for YTD and the other for MTD. I need to show the MTD and YTD slaes based on the below criteria.
1 If all Years are selected then it shoud show Latest year YTD. Same for for MTD
2 If multiple years are selected then YTD should show the total sum based on the year's selected.
Same principl for MTD Card also. If all years are slected then it should show the sum of all month slaes in the latest year. And if multiple months are selected then it shoul show the sum of sales based on the month's selected.
I have creaetd a clander table by using the below equation. and i am using this for year and month. Please help me to create a formula based on the below calender table.
Solved! Go to Solution.
@unnijoy , Based on Intital description. I think You need use has one value.
if it has one value then use time intelliegnece else use simple sum measure
example Ti measure
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
for hasonevalue refer : https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/
@unnijoy , Based on Intital description. I think You need use has one value.
if it has one value then use time intelliegnece else use simple sum measure
example Ti measure
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
for hasonevalue refer : https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/
Hi @amitchandak ,
When i use the month from the calander table that we are using it is not giving me the correct data.
Hi @amitchandak ,
thanks for your quick help. I tried using the above formula. But when i select multiple month MTD is showing the sum of sals for the latest month in the selected month. For example, if i select Oct -20,Nov -20 & Dec -20. Currently it is showing the Dec-20 sales sum as MTD. Actulay it should show the sales sum of Oct -20+Nov-20+Dec -20. And of all months are select then it should show the latest month sales.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
106 | |
98 | |
65 | |
54 |