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
I have as measure calculating sales of last 18 months:
Volume_18M = CALCULATE([Fsg volym];FILTER(Datum;Datum[Date]>DATE(YEAR(TODAY());MONTH(TODAY())-18;DAY(TODAY()))))
In a bar chart I want to display this per month.
To show when there is Zero sales I have selescted to show values without data but this gives me an X-axis like below.
How do I filter my datetable to only show values between Today and 18 months back on X-axis?
Solved! Go to Solution.
Unfortunatley this filters the categories on my X-axis if there is no data for the Year-Month.
I managed to get it working with this measure:
Volym_18M = CALCULATE( IF([Fsg volym]=0 && (LASTDATE(Datum[Date]) > DATE(YEAR(TODAY());MONTH(TODAY())-18;DAY(TODAY())) && LASTDATE(Datum[Date]) < TODAY()) ;0;[Fsg volym]); FILTER(Datum;Datum[Date]>DATE(YEAR(TODAY());MONTH(TODAY())-18;DAY(TODAY()))))
You can use the page level filter or visual level filter to get the last 18 month Volume, no need of writing dax for that. Try this and let me know if that fix your problem.
For more details you can follow this link
Unfortunatley this filters the categories on my X-axis if there is no data for the Year-Month.
I managed to get it working with this measure:
Volym_18M = CALCULATE( IF([Fsg volym]=0 && (LASTDATE(Datum[Date]) > DATE(YEAR(TODAY());MONTH(TODAY())-18;DAY(TODAY())) && LASTDATE(Datum[Date]) < TODAY()) ;0;[Fsg volym]); FILTER(Datum;Datum[Date]>DATE(YEAR(TODAY());MONTH(TODAY())-18;DAY(TODAY()))))
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 |
---|---|
94 | |
82 | |
82 | |
70 | |
49 |
User | Count |
---|---|
143 | |
123 | |
107 | |
61 | |
55 |