This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
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()))))
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 26 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 36 | |
| 32 | |
| 25 | |
| 23 |