Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Dear All,
I have a fairly simple problem - but i am lost and don't get the solution.
I have
My dummy report page does on include one table visual populated with IHB[Columns] and one slicer with date dimension. Slice can have multiple selections on date.
I want to be able to calculaton previous day amount of column 'IHB'[Amount (Curr)] with the below dax measure this works if i select more than one date. If i do only select one day (which should be base case usage) the measure is kept blank:
Can some please help? I have tried various approaches to tweak applied contexts, but faild:
PreviousDayAmountMeasure =
VAR CurrentDate = MAX('IHB'[Date])
VAR PreviousDate = CALCULATE(
MAX('IHB'[Date]),
FILTER(ALL('IHB'),
IHB[Date] < CurrentDate)
)
VAR PreviousDayAmount = CALCULATE(
SUM('IHB'[Amount (Curr)]),
ALL('IHB'[Date]),
'IHB'[Date] = PreviousDate,
ALLSELECTED('Date'[Datum])
)
RETURN IF(ISBLANK(PreviousDate), BLANK(), PreviousDayAmount)
Solved! Go to Solution.
Hi @BB76 ,
I think you are missing the DimDate in your visual as I mentioned in the previous reply-
Also, please ensure that in the Table Visual you are using the DimDate instead of the Fact Date.
Thank you very much @Prateek97 - highly appreciated.
One final question - is there an easy way to filter the next previous date which is not blank?
Hi @BB76 ,
Thank you for marking my reply as the solution.
Regarding your query, I think you want to filter the table visual to only show dates against which we have a sales value. You can apply a visual level filter on your original Sales column to show where Sum of Sales is not blank.
Hi @BB76 ,
If I removed the ALLSELECTED('Date'[Datum]) from PreviousDayAmount variable, it seems to be working fine.
Any specific reason for adding it?
it still doesn't work:Slicer 1 date
Slicer 2 dates
Hi @BB76 ,
I think what is happening is you have used a different 'datum' column in your date slicer. When you select only 1 value it will only have one date in the context and hence there will not be any previous day.
can you use the same date as in the table in the slicer as well?
Hi @Prateek97 ,
you are totally right and when changing slicer Date with the one from the facttable, it works. But the original approach has been done on purpse given that i have central Date DimTable which i use accors various FactTables and Repotslide. Any idea how to overcome this problem?
Hi @BB76 ,
Please use the below DAX.
PreviousDayAmountMeasure Using DimDate =
VAR CurrentDate = MAX('Calendar'[Date])
VAR PreviousDate = CALCULATE(
MAX('Calendar'[Date]),
FILTER(ALL('Calendar'),
'Calendar'[Date] < CurrentDate), FILTER(ALL('Sales Table'),'Sales Table'[SalesPrice]<>BLANK())
)
VAR PreviousDayAmount = CALCULATE(
SUM('Sales Table'[SalesPrice]),
ALL('Calendar'[Date]),
'Calendar'[Date] = PreviousDate
)
RETURN
IF(ISBLANK(PreviousDate), BLANK(), PreviousDayAmount)
Hi @Prateek97 ,
it does not really do the trick:
the measure should show up the previous day amount not on that day, but on the current day.
Hi @BB76 ,
I think you are missing the DimDate in your visual as I mentioned in the previous reply-
Also, please ensure that in the Table Visual you are using the DimDate instead of the Fact Date.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 98 | |
| 72 | |
| 50 | |
| 50 | |
| 44 |