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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
andybamber
Helper III
Helper III

ISINSCOPE Query

Hello All

 

I have a report, and have a headcount target at Domain level (this is the top level of 5). The report has a slicer which allows the user to view headcount at these various levels. I have a line chart which shows actual headcount over time... I also want to show headcount target but obviously only when the user is looking at the top Domain level. I thought if i created a measure below for the headcount target, and used isinscope to determine the level selected it would show actual headcount target at the Domain level, and then when they move below that it would show the Headcount measure (which means the actual and budget would display the same on the visual)... however it doesnt, and however low the user goes in the hierarachy it also shows the domain headcount target

 

Headcount_Budget_Wkly_Snap = SWITCH ( TRUE (), ISINSCOPE ( Domain_Table[cc_domain] ), [Headcount_Target], ISINSCOPE(OBS_MAPPING[obs_level3]), [Headcount], ISINSCOPE(OBS_MAPPING[obs_level4]), [Headcount],ISINSCOPE(OBS_MAPPING[obs_level5]), [Headcount] )

 

Thanks

Andy

8 REPLIES 8
Anonymous
Not applicable

ISINSCOPE need to be structured in a very specific way to work correctly. The most granular/detailed level must be first, then the second most granular... and so on.

thanks @Anonymous ... i tried that and it still doesnt ... stupid question probably, but does the hierarchy have to be structured as a Hierarchy? at the moment i have the Domain level from 1 table and the other Obs_Levels are from a different table, although there are obviously relationships in place to join them all, otherwise the slicer wouldnt work

 

Cheers

Andy

Anonymous
Not applicable

Please have a look at this: https://www.daxpatterns.com/hierarchies/
amitchandak
Super User
Super User

@andybamber , is showing headcount target at this level Domain_Table[cc_domain] on Job level 3,4,5 it should show Headcount . Is this what you need ?

See if this document can help : https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

 

or

Can you share sample data and sample output in table format?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

thanks @amitchandak  you are correct, that is how i need it to work... I looked at that link you gave me and I dont seem to be able to make that work, also tried daxer's suggestion to order from most granular to least and that doesnt work either... ill try and put together a sample file for you to look at...

 

Andy

Anonymous
Not applicable

Thanks @Anonymous @amitchandak  so i realised why it wasnt working, the visual didnt contain the domain or obs levels, that said i was hoping it would be able to work based off selections from the filter slicer.... when i applied to a visual which had domain and obs, it worked as expected when i drill through... but i guess the question is whether you can do a similar thing based off slicer selections?

 

Thanks

Andy

Anonymous
Not applicable

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.