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
Hi, I am trying to get previous date in the current row. somehow it works without [Name] column but as soon as [Name] gets included, it shows blanks as below. I hope to someone explains the reason why.
(The raw data is simple with name, date & price)
Thank you
Solved! Go to Solution.
Hi @colacan
This is not just a problem with the [Nmae] column. If you add the [Price] column, you will get the same result, as shown below.
Please note the part of the code circled in red.
When filter expressions are provided, the CALCULATETABLE function modifies the filter context to evaluate the expression. The CALCULATETABLE function used without filters achieves a specific requirement. It transitions row context to filter context.
For more information, please refer to:
CALCULATETABLE function (DAX) - DAX | Microsoft Docs
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @colacan
This is not just a problem with the [Nmae] column. If you add the [Price] column, you will get the same result, as shown below.
Please note the part of the code circled in red.
When filter expressions are provided, the CALCULATETABLE function modifies the filter context to evaluate the expression. The CALCULATETABLE function used without filters achieves a specific requirement. It transitions row context to filter context.
For more information, please refer to:
CALCULATETABLE function (DAX) - DAX | Microsoft Docs
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
(지환 후배님 반갑습니다. 전 통계92입니다.)
Unfortunately, I am not looking for the solution using FILTER(all(table), ... or FILTER(all(table[date]), due to the permermance issue. I am still looking for the REASON why above error of making the [prevdate] blank when the Name column gets included. it must be context problem which I can't figure out. Thanks.
Hi,
I am not sure if I understood your question correctly, but please try the below measure.
The reason is,
inside calculatetable DAX function, your measure only removes TestTable[Date] column.
I think TestTable[Name] column also has to be removed.
Prevdate =
VAR currentdate =
MAX ( TestTable[Date] )
VAR prevdate =
MAXX (
CALCULATETABLE (
TestTable,
FILTER ( ALL ( TestTable ), TestTable[Date] < currentdate )
),
TestTable[Date]
)
RETURN
prevdate
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |