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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Dynamic card value based on other visuals

I'm currently working on a report that has a shape map, a matrix and a card. The card displays the region that has been selected on the map. The table shows companies. I am needing the card to update based on whether one of the other visuals is interacted with, like so:

 

1. If nothing is selected (ie. nothing in the matrix is selected and no region on the map is selected) then the card reads "All"

2. If a region is selected then the card displays the name of the region.

3. If multiple regions are selected on the map or a company that is present in multiple regions is selected in the matrix, then the card reads "Multiple".

 

I have the following measure:

 

RegionSelector = IF(ISFILTERED('Exemptions Data'[Planning Regions]), SELECTEDVALUE('Exemptions Data'[Planning Regions], "Multiple"), "All")
 
This works for the map as in the numbered steps above but if I select a company in the matrix then the card will display "All" regardless of whether the company is present in 0, 1, or multiple regions.
 
Any help would be appreciated.
Thanks!

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

You can try this measure:

Measure =
VAR y =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[Region] ), ALLSELECTED ( 'Table' ) )
VAR x =
    IF (
        NOT ISFILTERED ( 'Table'[Region] ) && NOT ISFILTERED ( 'Table'[Company] ),
        "All",
        IF (
            HASONEVALUE ( 'Table'[Region] ),
            VALUES ( 'Table'[Region] ),
            IF ( y > 1, "Multiple" )
        )
    )
RETURN
    x

nothing is selectednothing is selected

one region is selectedone region is selectedcompany in multi regionscompany in multi regionsselect multi regionsselect multi regions

 

Sample file is attached that hopes to help you, please check and try it: Dynamic card value based on other visuals.pbix 

 

Best Regards,
Yingjie Li

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-yingjl
Community Support
Community Support

Hi @Anonymous ,

You can try this measure:

Measure =
VAR y =
    CALCULATE ( DISTINCTCOUNT ( 'Table'[Region] ), ALLSELECTED ( 'Table' ) )
VAR x =
    IF (
        NOT ISFILTERED ( 'Table'[Region] ) && NOT ISFILTERED ( 'Table'[Company] ),
        "All",
        IF (
            HASONEVALUE ( 'Table'[Region] ),
            VALUES ( 'Table'[Region] ),
            IF ( y > 1, "Multiple" )
        )
    )
RETURN
    x

nothing is selectednothing is selected

one region is selectedone region is selectedcompany in multi regionscompany in multi regionsselect multi regionsselect multi regions

 

Sample file is attached that hopes to help you, please check and try it: Dynamic card value based on other visuals.pbix 

 

Best Regards,
Yingjie Li

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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