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
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?

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
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.

Top Solution Authors