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

Show the data based on slicer selection in table visual

Hi Team,

 

I have 3 tables(Comments, Date & Country). 

Country table has only 5 regions & Comments table has one additional entry as Global. Below is how the tables are conencted.

tablerelations.PNG

 

Requirement: If nothing is selected in slicer it should show Global comments in table visual else Regional comments.Also it should change based on Date slicer.
I have used below DAX and could reach somewhat near but not getting output as expected.

Dax.PNG

Problem: In my Comments table there are multiple entries for "APAC". When I select APAC i get error in visual. Also it shows BLANK when I select Date slicer even though there is only 1 entry per region.

 

Need help on: If the Comments table has multiple region with same name it should show all comments or should changed based on dates. 

 

Snapshot of Country & Comments table as below:

 

Help is really appreciated. Thanks in advance.

 

Comments TableComments Table

Country TableCountry Table

 

Regards,

PS

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

You are getting the errors since you are returning VALUES in a measures and this returns several values when the return must be a single value try the following measure:

 

Comments =
IF (
    ISFILTERED ( Country[Region_Mapping] ),
    CONCATENATEX (
        VALUES ( Comments[Radar Chart Comments] ),
        Comments[Radar Chart Comments],
        ","
    ),
    CALCULATE (
        MAX ( Comments[Radar Chart Comments] ),
        FILTER ( Comments, Comments[Region] = "Global" )
    )
)

 

This will return a concatenated text:

MFelix_0-1621512568176.png

 

MFelix_1-1621512588500.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @Anonymous ,

 

You are getting the errors since you are returning VALUES in a measures and this returns several values when the return must be a single value try the following measure:

 

Comments =
IF (
    ISFILTERED ( Country[Region_Mapping] ),
    CONCATENATEX (
        VALUES ( Comments[Radar Chart Comments] ),
        Comments[Radar Chart Comments],
        ","
    ),
    CALCULATE (
        MAX ( Comments[Radar Chart Comments] ),
        FILTER ( Comments, Comments[Region] = "Global" )
    )
)

 

This will return a concatenated text:

MFelix_0-1621512568176.png

 

MFelix_1-1621512588500.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

@MFelix Thank you so much. Its working on a sample data. I will try on actual data too.

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.