Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
140 | |
71 | |
64 | |
52 | |
50 |
User | Count |
---|---|
209 | |
92 | |
64 | |
59 | |
56 |