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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

What is the best practice to show rows by latest date, grouped by two additional columns?

Hi all,

I have a table (tbl_Fact) with the following structure/contents:

 

SOURCE          STATUS          LOAD DATE     ROW COUNT

Office              Successful      12/03/2018        88
Office              Successful      13/03/2018        112

Warehouse      Failed             22/03/2018        2

Office              Failed              28/03/2018       110

Warehouse      Failed             14/03/20018      22

 

I would like to be able to show in a table visualisation the rows with the latest LOAD DATE, grouped by SOURCE and STATUS. So from the above dataset I would like to return the following subset:

 

SOURCE          STATUS          LOAD DATE     ROW COUNT
Office              Successful       13/03/2018       112

Office              Failed              28/03/2018       110

Warehouse      Failed             14/03/20018      22

      

What is the best practice to achieve this?

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-xjiin-msft
Solution Sage
Solution Sage

Hi @Anonymous,

 

To achieve your requirement, you can try following method:

 

1. Create a measure with following expression:

 

Last Date =
VAR Last =
    CALCULATE (
        MAX ( tbl_Fact[LOAD DATE] ),
        ALLEXCEPT ( tbl_Fact, tbl_Fact[SOURCE], tbl_Fact[STATUS] )
    )
RETURN
    IF ( MAX ( tbl_Fact[LOAD DATE] ) = Last, 1, 0 )

2. Put this measure in Visual level filters and set the filter to equal to 1.

 

 1.PNG2.PNG

 

Thanks,
Xi Jin.

View solution in original post

3 REPLIES 3
v-xjiin-msft
Solution Sage
Solution Sage

Hi @Anonymous,

 

To achieve your requirement, you can try following method:

 

1. Create a measure with following expression:

 

Last Date =
VAR Last =
    CALCULATE (
        MAX ( tbl_Fact[LOAD DATE] ),
        ALLEXCEPT ( tbl_Fact, tbl_Fact[SOURCE], tbl_Fact[STATUS] )
    )
RETURN
    IF ( MAX ( tbl_Fact[LOAD DATE] ) = Last, 1, 0 )

2. Put this measure in Visual level filters and set the filter to equal to 1.

 

 1.PNG2.PNG

 

Thanks,
Xi Jin.

Anonymous
Not applicable

ssobti - It wasn't what I was looking for but thanks for the effort in responding.

 

v-xjiin-msft - This is exactly what I am after. Thank you for your help, and apologies for the delay in providing gratitude.

Anonymous
Not applicable

Hi @Anonymous,

 

Right click on Load Date under Fields and click on Latest, it will then show only the latest date.

 

Does this help?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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