Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I could really use your help with the following measure.
I made a graph showing the total sales up to the selected month.
So if I select Dec 2018, I see jan - dec 2018.
If I select jan 2019, I see only jan 2019.
I used the following formula:
The slicer is based on Date[Date], the axis is based on Billing[Date]. But both are linked.
Now I would like to add a YTD line in this graph or in another graph if this is easier.
The import thing is that 'Current Year' depends on the selected month.
If jan 2019 is selected, then Current Year is 2019. If Dec 2018 is selected, Current Year is 2018.
Really appreciate your help!
Valérie
Solved! Go to Solution.
@Anonymous,
Please create a new date table using dax below. Please note that there is no relationship between the new date table and other table.
Calendar = CALENDARAUTO()
Then create the following measures in your table.
YTD = TOTALYTD([Total Turnover MSCI];'Date'[Date])
NewMeasure= var Ldate = MAX('Calendar'[Date])//Last date return if(min('Date'[Date])<=Ldate; [YTD])
At last, use date field of the new date table('Calendar'[Date]) to create slicer, create a line chart using 'Date'[Date] field and NewMeasure.
Regards,
Lydia
@Anonymous,
Please create a new date table using dax below. Please note that there is no relationship between the new date table and other table.
Calendar = CALENDARAUTO()
Then create the following measures in your table.
YTD = TOTALYTD([Total Turnover MSCI];'Date'[Date])
NewMeasure= var Ldate = MAX('Calendar'[Date])//Last date return if(min('Date'[Date])<=Ldate; [YTD])
At last, use date field of the new date table('Calendar'[Date]) to create slicer, create a line chart using 'Date'[Date] field and NewMeasure.
Regards,
Lydia
@v-yuezhe-msft i tried your solution and i do get a dynamic chart that displays data up to the month selected in the slicer but the displayed data points are filtered based on the context ie every month i see the total not the cumulative amount as it builds up month by month. is there a way to do this and have a dynamic line chart that builds up month by month?
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
90 | |
88 | |
83 | |
64 | |
49 |
User | Count |
---|---|
127 | |
108 | |
87 | |
70 | |
66 |