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
Anonymous
Not applicable

Creating a measure that would show the earliest message in a card visual

I have a column in a table called message list which shows a text field.

I also have a column that shows the date of each message.

 

[Message list] [Date]

 

I would like to show the earliest message in a card visual.

 

How can I create a measure for this please?

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

Hi @Anonymous ,

 

This is my test table1:

vyadongfmsft_0-1665395264935.png

 

Test table2:

vyadongfmsft_1-1665395343979.png

 

Please try following DAX:

Measure = IF(
    MINX(FILTER('Table1','Table1'[Date] = MIN('Table1'[Date])),'Table1'[Message list]) = BLANK(),
    "No error",
    MINX(FILTER('Table1','Table1'[Date] = MIN('Table1'[Date])),'Table1'[Message list])
    )

 

The result you want:

vyadongfmsft_2-1665395449291.png

 

 

Please refer the attached pbix file.

 

As for the another question "when I click on a graph it only shows the message then, otherwise it's hidden (no text in the card)", I think it's not possible.

 

Best regards,

Yadong Fang

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

4 REPLIES 4
v-yadongf-msft
Community Support
Community Support

Hi @Anonymous ,

 

This is my test table1:

vyadongfmsft_0-1665395264935.png

 

Test table2:

vyadongfmsft_1-1665395343979.png

 

Please try following DAX:

Measure = IF(
    MINX(FILTER('Table1','Table1'[Date] = MIN('Table1'[Date])),'Table1'[Message list]) = BLANK(),
    "No error",
    MINX(FILTER('Table1','Table1'[Date] = MIN('Table1'[Date])),'Table1'[Message list])
    )

 

The result you want:

vyadongfmsft_2-1665395449291.png

 

 

Please refer the attached pbix file.

 

As for the another question "when I click on a graph it only shows the message then, otherwise it's hidden (no text in the card)", I think it's not possible.

 

Best regards,

Yadong Fang

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

Anonymous
Not applicable

Thank you so much for this solution! 🙂

 

I did find a solution to hide the visual in the webpage below, so I'll incorporate that, please feel free to have a look yourself at it if you like.

Show or Hide a Power BI Visual Based on Selection - Excelerator BI

amitchandak
Super User
Super User

@Anonymous , Try a measure like

firstnonblankvalue(Table[Date], max(Table[Comment]))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Sorry I wasn't clear in what I wanted. May I ask if it can be tweeked as I need the earliest value even if it is blank.

 

Also, IF the value is blank I want it to say 'No Error' so I need the below included please 🙂

IF(
x = BLANK(),
"No Error",
x
)

 

I also wish to ask if this can be a filtered visual so that when I click on a graph it only shows the message then, otherwise it's hidden (no text in the card).

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!

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.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.