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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
max_mustermann
Frequent Visitor

Combine newest date and related text-value in a measure

My table_a looks as follows:

 

date   column1
01.02.2022   abc
05.03.2019   test
08.07.2005   test2

 

I just want to extract the newest date and the related text-value to a measure:

 

measure = MAX(table_a[date]) & " - " & table_a[column1]

 

But that does not work. I just want to get the following measure as a string:
01.02.2022 - abc

 

 

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @max_mustermann ,

Please try this:-

Measure_3 = 
VAR _max_date =
    CALCULATE ( MAX ( 'Table (5)'[date] ), ALL ( 'Table (5)' ) )
VAR _text_by_max_date =
    CALCULATE (
        MAX ( 'Table (5)'[   column1] ),
        FILTER ( 'Table (5)', 'Table (5)'[date] = _max_date )
    )
RETURN
    _max_date & "-" & _text_by_max_date

BR,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

1 REPLY 1
Samarth_18
Community Champion
Community Champion

Hi @max_mustermann ,

Please try this:-

Measure_3 = 
VAR _max_date =
    CALCULATE ( MAX ( 'Table (5)'[date] ), ALL ( 'Table (5)' ) )
VAR _text_by_max_date =
    CALCULATE (
        MAX ( 'Table (5)'[   column1] ),
        FILTER ( 'Table (5)', 'Table (5)'[date] = _max_date )
    )
RETURN
    _max_date & "-" & _text_by_max_date

BR,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.