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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors