Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

RANK USING LASTDATE() AND COLUMN TEXT

I need help creating a rank column that considers the alert column and the alert date

Attached data table.

Yellow fields used in the rank criterion and green column the required result. 🙂

PedroPablo_0-1664892547153.png

What I have done so far does not serve me, I attach it in case someone can correct me

-- no funciona todo queda en 1
 RANKX(ALLSELECTED(CONCLUSION[ALERTA], CONCLUSION[FECHA_ALERTA], CONCLUSION[RESPONSABLE], CONCLUSION[PROBLEMA]), LASTDATE(CONCLUSION[FECHA_ALERTA])) 
-- no funciona todo queda en 1
    RANKX(
        FILTER(CONCLUSION, 
        CONCLUSION[ALERTA]=EARLIER(CONCLUSION[ALERTA]) 
        && CONCLUSION[FECHA_ALERTA]=EARLIER(CONCLUSION[FECHA_ALERTA]) 
        && CONCLUSION[PROBLEMA]=EARLIER(CONCLUSION[PROBLEMA]) 
        && CONCLUSION[RESPONSABLE]=EARLIER(CONCLUSION[RESPONSABLE]))
        , CONCLUSION[FECHA_ALERTA], ,ASC,Skip)
-- funciona ok, pero no agrupa por alerta
RANKX(
        ALL( 
        CONCLUSION[ALERTA] 
        , CONCLUSION[FECHA_ALERTA]
        , CONCLUSION[PROBLEMA]
        , CONCLUSION[RESPONSABLE])
        , CONCLUSION[FECHA_ALERTA], ,DESC,Skip)
-- funciona ok, pero no agrupa por alerta
RANKX(CONCLUSION, LASTDATE(CONCLUSION[FECHA_ALERTA]))

I managed to create a measure, but it does not help me to use it as a page filter

Adjunct measure that works 🙂

Rank_FechaAlerta = RANKX(ALLSELECTED(CONCLUSION[ALERTA], CONCLUSION[FECHA_ALERTA], CONCLUSION[RESPONSABLE], CONCLUSION[PROBLEMA]), LASTDATE(CONCLUSION[FECHA_ALERTA]))

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

According to your description, from the result can see, you want to rank the FECHA_ALERTA column when the ALERTA column are the same.

vkalyjmsft_0-1664949515812.png

Here's my solution, create a calculated column.

Rank_FechaAlerta =
RANKX (
    FILTER ( CONCLUSION, CONCLUSION[ALERTA] = EARLIER ( CONCLUSION[ALERTA] ) ),
    CONCLUSION[FECHA_ALERTA],
    ,
    DESC,
    DENSE
)

Get the result.

vkalyjmsft_1-1664949669291.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
v-yanjiang-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

According to your description, from the result can see, you want to rank the FECHA_ALERTA column when the ALERTA column are the same.

vkalyjmsft_0-1664949515812.png

Here's my solution, create a calculated column.

Rank_FechaAlerta =
RANKX (
    FILTER ( CONCLUSION, CONCLUSION[ALERTA] = EARLIER ( CONCLUSION[ALERTA] ) ),
    CONCLUSION[FECHA_ALERTA],
    ,
    DESC,
    DENSE
)

Get the result.

vkalyjmsft_1-1664949669291.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.