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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ThomasWeppler
Skilled Sharer
Skilled Sharer

Only sum up a matrix when it is drilled down.

Hi BI community

I have build a matrix where the first level look at the customers and the next level looks at the assinments attached to each customer.

I want to see each assingmentID when I drill down and look at the assingments, but not when I look at the customers, since it confuses the end user.
To do this I have wrote this line in Dax that only shows the assingmentID when I look at a single assingment.

Dax Magic = IF(COUNT(Assignment[assignmentId]) <> 1, BLANK(), SELECTEDVALUE(Assignment[assignmentId]))

 

bi question.png

 

The first box shows how the assingmentsID is hidden when the number of assingment is diffrent from one on a customer (good)
The second box shows how I can see the assingmentID when I drill down. (Also good)
The third box shows that when a customer only have a single assingment attached to it I will still see the assingmentnumber even though I have not drilled down (NOT good)

Does anyone here know that how I can also hide the number when a customer only have a single assingment attached to it until I drill down?

All help is greatly appreciated.

1 REPLY 1
ThomasWeppler
Skilled Sharer
Skilled Sharer

After a some time on google I found a solution myself.
It seems like the best way to solve this problem is to use the IsInScope function.
If anyone else has a similar problem this was the best guide I found on the problem.
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

A moderator can close this topic.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.