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
ChristianDLS56
Frequent Visitor

Measure that depends on chosen values on filter

Hi, everyone!

I'm experiencing a bit of a hiccup right now.

 

I have a card that displays the name of the country chosen in a filter. My filter contains Region > Cluster > Country hierarchy.

 

For example, I choose "Thailand" > the card will display "Thailand". I did this by making a measure [CountryName]

[CountryName] = DISTINCT('Filter Table - Country'[Country])

 

Filter Table - Country

CountryClusterRegion
ThailandTMLAsia
VietnamMSVAsia
MyanmarTMLAsia
LaoTMLAsia
SingaporeMSVAsia
PhilippinesPHAsia

 

 

Now, I want to be able to make a measure that shows the cluster when ALL of the countries were chosen under that. For example, I choose Thailand, Myanmar, and Lao in the filter > I want the card to show "TML".

 

Would anyone know how to make this possible? Will really help me a lot.

 

Thanks!

4 REPLIES 4
amitchandak
Super User
Super User

@ChristianDLS56 , You need one copy of Country to independent means do not join fact

 

Then create measure like

= var _clu = summarize(allselected(IndCountry),  IndCountry[cluster])

return

calculate(count(Table[Value]), filter(Country, Country[cluster] in _clu ) )

 

Need of an Independent Table in Power BI - Exclude: https://youtu.be/lOEW-YUrAbE

Hi @amitchandak 

 

Appreciate your suggestion. Sadly, it doesn't work yet.

 

I tried doing your suggestion and ended up getting numbers - I think because of the COUNT in the measure. I figured it's because it's returning the number of countries chosen in the filter, when it's supposed to be showing either the Country or the Cluster...

= var _clu = summarize(allselected(IndCountry),  IndCountry[cluster])

return

calculate(count(Table[Value]), filter(Country, Country[cluster] in _clu ) )

@ChristianDLS56 , check if this file can help

Hi @amitchandak .

 

Wow, thanks for going out of your way to offer solution.

 

I checked the file you attached and see that you used CONCATENATEX...

Not exactly what I was hoping for.

 

I would want to be able to do this:

If I choose Thailand on the filter > I want the measure to show "Thailand"

If I choose Mynamar on the filter > I want the measure to show "Myanmar"

If I choose Thailand, Myanmar, AND Lao on the filter > I want the measure to show "TML" which is their Cluster.

 

Note that I only want the name of the cluster to show when I choose ALL of the countries under that cluster. So for example I choose Vietnam AND Singapore, I would want the measure to show "MSV".

 

Is that possible? 😊

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.