Forum Discussion
Anonymous
2 years agoNot applicable
How do I use RANK() to rank date
Hi, I am new to PowerBI! What I have is the EQP_ID & FCST_TIME, and I would like to add a column called "Rank' to display the FCST_OUT_TIME ranking by Measure Function The earliest FCST_OU...
- 2 years ago
hello Anonymous
please check if this accomodate your need.
create new calculated column with following DAX:
Rank =
var _Rank =
RANKX(
FILTER(
'Table',
'Table'[FCST_OUT_TIME]
),
'Table'[FCST_OUT_TIME],
,ASC
)
Return
IF(
ISBLANK('Table'[FCST_OUT_TIME]),
0,
_Rank
)Hope this will help you.
Thank you.
Jihwan_Kim
2 years agoSuper User
Hi,
I am not sure how your semantic model looks like, but please check the below picture and the attached pbix file.
It is for creating a measure.
RANK function (DAX) - DAX | Microsoft Learn
Rank measure: =
IF (
HASONEVALUE ( data[eqp_id] ),
RANK (
SKIP,
SUMMARIZE (
FILTER ( ALL ( data ), data[fcst_out_time] <> BLANK () ),
data[eqp_id],
data[fcst_out_time]
),
ORDERBY ( data[fcst_out_time], ASC )
) + 0
)
- Anonymous2 years agoNot applicable
- Anonymous2 years agoNot applicable
And there's also another error message