The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I need to add one custom column called "rank" by using below expression :
sum(cast(booked != lag(booked,1)
Can Someone please help with the DAX/Measure expression.
Thanks in advance
Hi @Rup10 ,
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it.
Best Regards,
Eyelyn Qin
Hi @Rup10 ,
Based on my researching, the LAG function returns values from a previous row in the table and the CAST function converts an expression from one datatype to another datatype.
But actually I'm not sure about your expected output, could please share more detail information to help us clarify your scenario?
In case you want the final result as shown below:
Please try LOOKUPVALUE() , RANKX() to add columns after adding a Index column in Power Query
CAST =
IF (
[BOOKED]
<> LOOKUPVALUE ( 'Table'[BOOKED], 'Table'[Index], [Index] - 1 ),
1,
0
)
rankColumn =
RANKX ( 'Table', [BOOKED],, ASC, DENSE )
Here is the pbix file.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Rup10 ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
80 | |
78 | |
44 | |
37 |
User | Count |
---|---|
157 | |
113 | |
64 | |
60 | |
55 |