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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Custom message in card visualization based on selected value

Hello,

I have the following table and i am trying to have a card visualization which displays all the text messages associated with a barcode when it is selected, otherwise, it should display "More than one barcode selected". Any help is much appreciated!

BarcodeText messageValue
3998closed line215
4050open and processing189
4050pending approval214
4060suspended158
4139open and awaiting54
4145open and awaiting14
4149open and awaiting548
4157open and awaiting21
4160pending approval54
4160pending approval158
4164pending approval514
4166pending approval155
4187suspended187
4187closed line885
4187open and processing584
4187closed line879
4248open and processing931
4314closed line157
4474open and processing158
4481open and processing145
4487pending approval789
4495suspended652
4685open and awaiting365
4688open and processing144
4691pending approval15
4813suspended145
4832open and awaiting84
4997open and processing641

Here is the measure that i am currently using:

 

 

Barcode Selected Measure = 
IF (
    CALCULATE (
        HASONEVALUE ( 'My Table'[Text message] ),
        ALLSELECTED ( 'My Table' )
    )
        = TRUE (),
    SELECTEDVALUE ( 'My Table'[Text message] ),
    "More than one barcode selected"
)

 

 

Expected results:

1. when the barcode 3998 is selected from the table visualization, the card visualization displays the text: "closed line". This part is already working.

2. when the barcode 4050 is selected from the table visualization, the card visualization should display the text: "open and processing, pending approval". So, it should join all the text messages associated with that barcode. This part is not working. It currently shows "More than one barcode selected" which is wrong.

3. when more than one barcode is selected from the table visualization (i use ctrl+ to select multiple lines from the table), the card visualization displays the text: "More than one barcode selected". This part is already working.

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Anonymous,

 

Try this measure:

 

Barcode Selected Measure = 
IF (
    NOT HASONEVALUE ( 'My Table'[Barcode] ), "More than one barcode selected",
    CONCATENATEX ( 'My Table', 'My Table'[Text message], ", " )
)

 

DataInsights_0-1659532278808.png

-----

 

DataInsights_1-1659532294855.png

-----

DataInsights_2-1659532306597.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
DataInsights
Super User
Super User

@Anonymous,

 

Try this measure:

 

Barcode Selected Measure = 
IF (
    NOT HASONEVALUE ( 'My Table'[Barcode] ), "More than one barcode selected",
    CONCATENATEX ( 'My Table', 'My Table'[Text message], ", " )
)

 

DataInsights_0-1659532278808.png

-----

 

DataInsights_1-1659532294855.png

-----

DataInsights_2-1659532306597.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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