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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
jitpbi
Post Patron
Post Patron

select value for latest timestamp

Hi,

 

I have a set of values and I would like to select the latest value of RUL for each ICR and Inverter based on the Datetime created. 

 

from the below table latest RUL for ICR1 and INV1 will be 40 where Datetime is 1/12/2021 11:46:10 AM

and for ICR4 and INV1, RUL will be 8.6 where Datetime is 1/12/2021 1:18:59 PM

 

ICRInverterRULDatetime
ICR1INV1201/12/2021 10:32:59 AM
ICR1INV230.51/12/2021   8:10:54 AM
ICR1INV1401/12/2021 11:46:10 AM
ICR1INV210.41/12/2021 12:42:59 AM
ICR4INV112.31/12/2021   7:12:59 AM
ICR4INV1231/12/2021  8:30:10 AM
ICR2INV3181/12/2021  9:13:59 AM
ICR2INV3441/12/2021  1:10:59 PM
ICR4INV18.6 1/12/2021 1:18:59 PM

 

Please suggest how to achieve this if i have to show the latest value of RUL for each ICR and Inverter in a matrix visual.

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jitpbi , Try three measures like

 

last ICR = lastnonblankvalue(Table[Datetime], max(Table[ICR]))
last Inverter = lastnonblankvalue(Table[Datetime], max(Table[Inverter]))
last RUL = lastnonblankvalue(Table[Datetime], max(Table[RUL]))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @jitpbi ,


According to your request, I did the following test, just create a calculated column. The idea is that the value returned by the current row is the RUL value corresponding to the latest date when the column ICR and the column Inverter are the same. The specific reference is as follows:

 

 

Result = 
CALCULATE (
    MAX ( 'Table'[RUL] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[ICR] = EARLIER ( 'Table'[ICR] )
            && 'Table'[Inverter] = EARLIER ( 'Table'[Inverter] )
            && 'Table'[Datetime]
                = CALCULATE (
                    MAX ( 'Table'[Datetime] ),
                    FILTER (
                        ALL ( 'Table' ),
                        'Table'[ICR] = EARLIER ( 'Table'[ICR] )
                            && 'Table'[Inverter] = EARLIER ( 'Table'[Inverter] )
                    )
                )
    )
)

 

v-henryk-mstf_2-1610613113372.png

 

Here is the sample pbix file.

 

If the problem is still not resolved, please provide detailed error information and let me know immediately, looking forward to your reply.


Best Regards,
Henry


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

amitchandak
Super User
Super User

@jitpbi , Try three measures like

 

last ICR = lastnonblankvalue(Table[Datetime], max(Table[ICR]))
last Inverter = lastnonblankvalue(Table[Datetime], max(Table[Inverter]))
last RUL = lastnonblankvalue(Table[Datetime], max(Table[RUL]))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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