Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I've created a measure to calculate another measure only for dates before a particular date.
i.e. CALCULATE( [measure] , [date] < 01/09/2019)
But my result is coming up as blank. Can someone tell me what is wrong with this formula? Reason for this formula is that I want to create a measure for before and after this date and then calculate the difference between these.
Solved! Go to Solution.
Hi @bo_afk ,
CALCULATE needs two kinds of parameter: Expression and Filter. So you need a table range to get a filter.
So you could try the following DAX:
Measure =
CALCULATE ( [measure], FILTER ( 'Table', [date] < DATE ( 2019, 1, 9 ) ) )
Hi @bo_afk ,
CALCULATE needs two kinds of parameter: Expression and Filter. So you need a table range to get a filter.
So you could try the following DAX:
Measure =
CALCULATE ( [measure], FILTER ( 'Table', [date] < DATE ( 2019, 1, 9 ) ) )
Hi @bo_afk ,
I'm not totally sure because dates are always something tricky 😁.
Try to format it inside DATE function I think that would pass it with no problems.
Let me know if it helped.
BR,
DR
Thanks for your suggestion @Anonymous
I did try using the date function but it didn't seem to work. I suspect that's because it outputs a datetime format and my data has only date. I think tried to format it as "dd/mm/yyyy" but then got an error that I can't compare date values with text.
Update: so the date function works when I use a simple sum as my calculation, but when I input my measure, it doesn't work. Must be an issue with my measure then.
Most likely, I would need some sample data to make a few tests but that usually work.
In general, does the calculate formula work with measures and dates?
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 49 | |
| 40 | |
| 32 | |
| 14 | |
| 13 |
| User | Count |
|---|---|
| 87 | |
| 72 | |
| 37 | |
| 28 | |
| 26 |