cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
AaronGlenn10
Helper III
Helper III

Hiding data or values based on selection

I have a dashboard containing restaurants sales across the State of Texas -- when a user selects a City then the top performing location for that City will display [see below[ - however, when a user selects a Individual Location/Restaurant then it returns the name of that restaurant and a (Blank) for the value [see below].  Is there a way for the entire section to be blank when an invidual location is selected instead of a City [will all locations selected under that City]?

 

Here is the measure I'm using to return top performing restaurant in the Selected City ->

TopLocationSales = calculate([TABC Sales (CY)],KEEPFILTERS((topn(1, all (TABC[Location Name/City/Number]), [TABC Sales (CY)]))))

 

AaronGlenn10_0-1645359052542.png

 

AaronGlenn10_1-1645359265066.pngAaronGlenn10_2-1645359317663.png

 

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @AaronGlenn10 

 

You could use HASONEVALUE function (DAX) in an IF condition in your measure. Below is an example.

Measure 2 = IF(HASONEVALUE('Table (4)'[Item]),BLANK(),[Measure])

vjingzhang_0-1645601586771.png

 

In your scenario, you could try

IF(HASONEVALUE('Table (4)'[Location Name]),BLANK(),[TopLocationSales])

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @AaronGlenn10 

 

You could use HASONEVALUE function (DAX) in an IF condition in your measure. Below is an example.

Measure 2 = IF(HASONEVALUE('Table (4)'[Item]),BLANK(),[Measure])

vjingzhang_0-1645601586771.png

 

In your scenario, you could try

IF(HASONEVALUE('Table (4)'[Location Name]),BLANK(),[TopLocationSales])

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors