Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
I want to create a formula in DAX, which create a case/ condition as column - status (New, updated,unchanged).
that should compare between today vs yesterday (latest date as of yesterday) and primary key, sales )
Let me know if the above question/query is still unclear.
Thank you very much for the support.
Greeting,
Solved! Go to Solution.
@amitchandak thank you for the code.
if in the above scenario, if I want to find the delta of sales with reference today(the one which I filter) and yesterday (with reference to filtered)- what could you suggest to write in dax.
thank you in advance.
Hi @surajbh ,
The reference could be like this:
Reference =
VAR _last =
MAXX (
FILTER (
'Table',
[Date]
= EARLIER ( 'Table'[Date] ) - 1
&& [Primary key] = EARLIER ( 'Table'[Primary key] )
),
[Sales]
)
return
[Sales] - _last
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-yingjl thank you for the support.
if in the above-given scenario, the user has the possibility of filtering or choosing ( two dates- one to another date ), that will determine the status of the primary key.
How could you write DAX.
thank you in advance for the support.
@surajbh , Try a new column
new column =
var _last = maxx(filter(Table, [Date] =earlier([Date])-1 && [primary key] =earlier([primary key])),[sales])
return
Switch(true() ,
isblank(_last) , "New" ,
_last <> [sales] , "Updated"
,"same"
)
@amitchandak thank you for the code.
if in the above scenario, if I want to find the delta of sales with reference today(the one which I filter) and yesterday (with reference to filtered)- what could you suggest to write in dax.
thank you in advance.
Hi @surajbh ,
The reference could be like this:
Reference =
VAR _last =
MAXX (
FILTER (
'Table',
[Date]
= EARLIER ( 'Table'[Date] ) - 1
&& [Primary key] = EARLIER ( 'Table'[Primary key] )
),
[Sales]
)
return
[Sales] - _last
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
14 | |
12 | |
11 | |
10 | |
8 |