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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
AMCMILLAN
Advocate I
Advocate I

Clustered Column Using Inscope

Hi all,

 I have been asked to created a Clustered Column chart which is filtered based on a Slicer with a Hierarchy of the company.

 The issue I have is that I am using inscope to return the max values for the BRAG based on the slicer selected, however when I select a different level of the hierarchy in the slicer, it only slices on the top level in the hierarchy.
Any ideas on why this is happening or how to fix this?

 This is the measure for inscope....Cost Centre is the lowest level in the hirearchy

Total BRAG Norm =
SWITCH (
    TRUE (),
    ISINSCOPE ( 'Cost Centres'[COST_CENTRE_LABEL] ), MAX ( 'SummarizedTableNorm'[GM_TOTAL_BRAG]),
    ISINSCOPE ( 'Cost Centres'[AREA_LABEL]), MAX ( 'SummarizedTableNorm'[BDM_TOTAL_BRAG] ),
    ISINSCOPE ( 'Cost Centres'[OM_LABEL] ), MAX ( SummarizedTableNorm[OM_TOTAL_BRAG] ),
    ISINSCOPE ( 'Cost Centres'[DIVISION_LABEL] ), MAX ( SummarizedTableNorm[DIV_TOTAL_BRAG] ),
    ISINSCOPE ( 'Cost Centres'[BU_LABEL] ), MAX ( SummarizedTableNorm[BU_TOTAL_BRAG])
)
 SummarizedTableNorm contains a report key which is linked to the Cost Centres Table

Thanks

 

1 ACCEPTED SOLUTION

Hi @AMCMILLAN ,

The reason you’re encountering this issue is that SELECTEDVALUE only returns a result when there’s a single item in context. If multiple cost centres are present, it returns blank, which is why you’re not seeing any values.

To address this, you can use HASONEVALUE in your measure. This approach checks if only one item exists at each level and then returns the appropriate BRAG value:

Total BRAG Norm =
SWITCH (
   TRUE(),
   HASONEVALUE('Cost Centres'[BU_LABEL]), MAX(SummarizedTableNorm[BU_TOTAL_BRAG]),
   HASONEVALUE('Cost Centres'[DIVISION_LABEL]), MAX(SummarizedTableNorm[DIV_TOTAL_BRAG]),
   HASONEVALUE('Cost Centres'[OM_LABEL]), MAX(SummarizedTableNorm[OM_TOTAL_BRAG]),
   HASONEVALUE('Cost Centres'[AREA_LABEL]), MAX(SummarizedTableNorm[BDM_TOTAL_BRAG]),
   HASONEVALUE('Cost Centres'[COST_CENTRE_LABEL]), MAX(SummarizedTableNorm[GM_TOTAL_BRAG])
)

 

This should prevent blanks when slicing at higher levels. If you continue to see blanks at the cost centre level, consider adding a fallback aggregation such as MAXX or SUMX across cost centres to ensure the measure returns a value when multiple centres are involved.

 

I haven’t tested this in your specific model, so please use it as a starting point. If you continue to encounter blanks at the lowest level, consider adding a fallback aggregation such as MAXX or SUMX over the cost centres to address situations where multiple cost centres are included.

 

Let's give it a try and let us know how it goes.

View solution in original post

10 REPLIES 10
AMCMILLAN
Advocate I
Advocate I

So if it helps, the Cost Centre Label has more than 1 label associated to the parent in the hierarchy, will this be the reason why I am returning blanks

 

@AMCMILLAN , if you can use a field parameter for the axis. I have created this example to change the measure based on that 
Changing measures based on the axis with Field Parameters in Power BI. Dynamic measures based on the axis/Dimension: https://youtu.be/7ikRAelDph0

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

Thank-you for the reply Amit. I don't think that will work for me I am afraid, although very comprehensive.
I can see all the hierarchies within the slicer and of the 5 levels, the clustered chart will be filtered on the 1st 4 levels.
However when I click on the Centre Level (Lowest Level), it returns blanks values and when I put it into a table it just lists the name of the Centre rather than the values it should show (Ie Score for each Month of 2025)

Hi @AMCMILLAN ,

The reason you’re encountering this issue is that SELECTEDVALUE only returns a result when there’s a single item in context. If multiple cost centres are present, it returns blank, which is why you’re not seeing any values.

To address this, you can use HASONEVALUE in your measure. This approach checks if only one item exists at each level and then returns the appropriate BRAG value:

Total BRAG Norm =
SWITCH (
   TRUE(),
   HASONEVALUE('Cost Centres'[BU_LABEL]), MAX(SummarizedTableNorm[BU_TOTAL_BRAG]),
   HASONEVALUE('Cost Centres'[DIVISION_LABEL]), MAX(SummarizedTableNorm[DIV_TOTAL_BRAG]),
   HASONEVALUE('Cost Centres'[OM_LABEL]), MAX(SummarizedTableNorm[OM_TOTAL_BRAG]),
   HASONEVALUE('Cost Centres'[AREA_LABEL]), MAX(SummarizedTableNorm[BDM_TOTAL_BRAG]),
   HASONEVALUE('Cost Centres'[COST_CENTRE_LABEL]), MAX(SummarizedTableNorm[GM_TOTAL_BRAG])
)

 

This should prevent blanks when slicing at higher levels. If you continue to see blanks at the cost centre level, consider adding a fallback aggregation such as MAXX or SUMX across cost centres to ensure the measure returns a value when multiple centres are involved.

 

I haven’t tested this in your specific model, so please use it as a starting point. If you continue to encounter blanks at the lowest level, consider adding a fallback aggregation such as MAXX or SUMX over the cost centres to address situations where multiple cost centres are included.

 

Let's give it a try and let us know how it goes.

Thank-you for the reply, it worked but needed to change the list so that COst centre was at the top and BU at the bottom. Was the last part of the puzzle and now can go live.
Thank-you again.

Thanks for the update. Stay engaged with the community for upcoming discussion

AMCMILLAN
Advocate I
Advocate I

Sorry, I have it, this is the new measure I have created and seems to work until I choose the lowest level then it returns blank values

 

Total BRAG Norm =
SWITCH (
    TRUE (),
    SELECTEDVALUE( 'Cost Centres'[BU_LABEL] ,MAX ( SummarizedTableNorm[BU_TOTAL_BRAG])),
    SELECTEDVALUE ( 'Cost Centres'[DIVISION_LABEL] , MAX ( SummarizedTableNorm[DIV_TOTAL_BRAG] )),
    SELECTEDVALUE ( 'Cost Centres'[OM_LABEL] , MAX ( SummarizedTableNorm[OM_TOTAL_BRAG] )),
    SELECTEDVALUE ( 'Cost Centres'[AREA_LABEL], MAX ( 'SummarizedTableNorm'[BDM_TOTAL_BRAG] )),
    SELECTEDVALUE ( 'Cost Centres'[COST_CENTRE_LABEL] , MAX ( 'SummarizedTableNorm'[GM_TOTAL_BRAG]))    
)

 

danextian
Super User
Super User

Hi @AMCMILLAN 

 

I'm not exactly sure what you're trying to achieve but if the order of the columns in your switch measure is the actual hierarchy then that is because the first condition is already met which will always holds true even if you expand into the next level in the hierarchy - ie, it is always inscope - so you get only the value for the first hierarchy. Try reversing the order.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
rohit1991
Super User
Super User

Hii @AMCMILLAN 

 

INSCOPE() only checks what level of the visual axis is currently being evaluated.
It does not react to slicers that change the hierarchy level  so when you slice higher levels (BU, Division, OM, etc.), the visual still evaluates the lowest level present in the visual, which in your case is always Cost Centre.
That’s why your measure always returns the first branch of the SWITCH() and behaves like it only slices the top level.

To fix the behaviour, you must detect the slicer selection using HASONEVALUE() (or SELECTEDVALUE) instead of INSCOPE


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Thanks Rohit1991 for the reply, that makes sense, how would I use this within my measure?

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.