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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Chancellor
Frequent Visitor

How to only show measure when specific dimensions is chosen

I have at data set which in general is like this example:

SchoolClassAdressPopulationClasstype
Greenville1Littletown12A
Old public1Beartown2A
Blue Tech1Donkeytown41A
Greenville2Littletown3B
Old public2Beartown12B
Blue Tech2Donkeytown31B
Greenville3Littletown44C
Old public3Beartown12C
Blue Tech3Donkeytown12C


 I am trying to make a report where I only show the measure Population in the report when specific dimensions is chosen.


The rules are as follows:

A)When Class + Classtype is chosen in the filter then show Population 
B)When All other dimensions in combinations with classtype is chosen then blank population

C)Else show population (e.g. all other filter values are accepted).

 

Im having a hard time especially regardring the B-part of the rules. Any suggestions?
I think A should be IF (ISINSCOPE ([Class]) && ISINSCOPE ([Classtype), Population)

Rest should be an OR statement nested - or what?

1 ACCEPTED SOLUTION

HI. Almost 🙂 I found a solution with IS IN SCOPE + IF. Thank you it helped .

View solution in original post

5 REPLIES 5
v-yadongf-msft
Community Support
Community Support

Hi @Chancellor ,

 

Please try following DAX:

Measure = 
var class_is_filter=HASONEFILTER(Sheet21[Class])
return
IF(class_is_filter,CONCATENATEX(Sheet21,[Population],"; "))

 

Is this the result you want?

vyadongfmsft_0-1661940505050.png

If I misunderstand your demands, please feel free to contact us in time.

 

Best regards,

Yadong Fang

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

HI. Almost 🙂 I found a solution with IS IN SCOPE + IF. Thank you it helped .

Chancellor
Frequent Visitor

@Greg_Deckler  Thanks for the input. The problem with HASONE VALUE is it only filters correct if I choose a filter value. 

Example: 

Measuretest:= if (HASONEVALUE([Classtype])

&& or (HASONEVALUe ([Address]), HASONEVALUE([School])), BLANK(), [Population])

The input here only blanks classtypes when I filter on one value of adress or school. I want it to blank in ALL cases where I choose for examples adresse and classtype in the filter. 

@Chancellor Wouldn't it just be:

IF(HASONEVALUE([Classtype]) && HASONEVALUE([Class]),[Population], BLANK())



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@Chancellor Perhaps try HASONEVALUE instead of ISINSCOPE



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.