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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AparnaJ
Helper I
Helper I

Check if latest values exists

Hi,

Here is my data:

AparnaJ_0-1669933032838.png

 

We need to show latest record, and for person "David", the latest record 1/22/2022 row will be displayed. Challenging part is need to show if Symptom 1 or 2 from this date existed in past. Fever is new symptom and should be highlighted here. Is there a way to do this in Power BI. Any help is appreciated. Thank you.

1 ACCEPTED SOLUTION
v-xiaosun-msft
Community Support
Community Support

Hi @AparnaJ ,

 

According to your description, I made the sample and here is my solution.

Create a column to return the latest date of each person.

 

latestdate = 
MAXX (
    FILTER (
        'Table',
        'Table'[Symptom1] = EARLIER ( 'Table'[Symptom1] )
            || 'Table'[Symptom2] = EARLIER ( 'Table'[Symptom2] )
    ),
    'Table'[Date]
)

 

Then create a column to show if Symptom 1 or 2 from this date existed in past.

 

Column = 
IF (
    COUNTROWS (
        FILTER (
            'Table',
            'Table'[Person] = EARLIER ( 'Table'[Person] )
                && 'Table'[Date] = [latestdate]
        )
    ) > 0,
    TRUE ()
)

 

Then create a new table to only show the row of the latest record.

 

Table 2 = 
CALCULATETABLE ( 'Table', 'Table'[Date] = 'Table'[latestdate] )

 

In new table, create a measure to use "conditional format".

 

highlight = 
IF (
    MAX ( 'Table 2'[Symptom1] ) = "Fever"
        || MAX ( 'Table 2'[Symptom2] ) = "Fever",
    1
)

 

Then right click "Symptom1".

vxiaosunmsft_0-1669951224252.pngvxiaosunmsft_1-1669951274982.png

Final output:

vxiaosunmsft_0-1669958213974.png

 

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ xiaosun

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-xiaosun-msft
Community Support
Community Support

Hi @AparnaJ ,

 

According to your description, I made the sample and here is my solution.

Create a column to return the latest date of each person.

 

latestdate = 
MAXX (
    FILTER (
        'Table',
        'Table'[Symptom1] = EARLIER ( 'Table'[Symptom1] )
            || 'Table'[Symptom2] = EARLIER ( 'Table'[Symptom2] )
    ),
    'Table'[Date]
)

 

Then create a column to show if Symptom 1 or 2 from this date existed in past.

 

Column = 
IF (
    COUNTROWS (
        FILTER (
            'Table',
            'Table'[Person] = EARLIER ( 'Table'[Person] )
                && 'Table'[Date] = [latestdate]
        )
    ) > 0,
    TRUE ()
)

 

Then create a new table to only show the row of the latest record.

 

Table 2 = 
CALCULATETABLE ( 'Table', 'Table'[Date] = 'Table'[latestdate] )

 

In new table, create a measure to use "conditional format".

 

highlight = 
IF (
    MAX ( 'Table 2'[Symptom1] ) = "Fever"
        || MAX ( 'Table 2'[Symptom2] ) = "Fever",
    1
)

 

Then right click "Symptom1".

vxiaosunmsft_0-1669951224252.pngvxiaosunmsft_1-1669951274982.png

Final output:

vxiaosunmsft_0-1669958213974.png

 

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ xiaosun

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.