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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
JohnD2
Frequent Visitor

trying to list the most recent value of a type

Hi,

I am trying to list the most recent value of a type.


date     type    value
1-1-2016 RED     210
2-1-2016 RED     170
10-1-2016 RED    190
1-1-2016 GREEN   400
15-1-2016 GREEN  560
16-1-2016 GREEN  500
2-2-2016 YELLOW  180
10-2-2016 YELLOW 200
18-2-2016 YELLOW 240

The only result that I want to have in a calculate table is:

10-1-2016 RED 190
16-1-2016 GREEN 500
18-2-2016 YELLOW 240

 

But every time, i get the sum of all three line items (for yellow: 180+200+240, instead of 240).

I manage to select the lastdate, with LASTDATE(date), but i get always the summed (180+200+240) value.

 

What about to create a calculated table, that has only the last values in it per type? Then is will not sum the different values for the dates as these are not in the table.

 

Any suggestions?

John

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

hi @JohnD2

 

A give you a solution but not using calculate table;

 

1: Create a measure:

 

RankDate =
RANKX (
    ALLEXCEPT ( Table1, Table1[Type] ),
    CALCULATE ( VALUES ( Table1[Date] ) ),
    ,
    DESC,
    SKIP
)

2, Use this measure as Visual Level filters

 

DD.png

 

 

 




Lima - Peru

View solution in original post

1 REPLY 1
Vvelarde
Community Champion
Community Champion

hi @JohnD2

 

A give you a solution but not using calculate table;

 

1: Create a measure:

 

RankDate =
RANKX (
    ALLEXCEPT ( Table1, Table1[Type] ),
    CALCULATE ( VALUES ( Table1[Date] ) ),
    ,
    DESC,
    SKIP
)

2, Use this measure as Visual Level filters

 

DD.png

 

 

 




Lima - Peru

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.