cancel
Showing results for 
Search instead for 
Did you mean: 
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
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
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

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
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors