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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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?

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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