cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tjeerd
Frequent Visitor

Isolate measure from graph category

Hi all,

 

I have found a lot of answers to questions I had on this forum. Now I encounter a challenge to which I cannot find a comparable post yet. 

 

I want to present a distribution of shipment methods. If the total number of shipments is equal of greater than 30, I deem the distribution to be representative. If so, I want to color the bars white. If total shipments <30, I want to color the bars pink. 

 

Challenge I encounter, is that the category drills down the total shipments, and colors the bars based on number of shipments per category. 

 

I tried to workaround this, by setting a measure: if #shipments >30, true = 1, false = 0.

However, also doing it this way, the shipments are also drilled down by the category.

 

Is there a way to isolate the measurement from this? While still being affected by a date slicer for instance? 

 

Please see the link for a better understanding of my challenge. I want to have all bars pink if total shipment <30, white if >29.

 

Thank you in advance!

 

https://imgur.com/LddbULt

1 ACCEPTED SOLUTION
Tjeerd
Frequent Visitor

Hi all,

 

First of all thank you for your your replies and the time you put into my challenge!

I did not came directly to the solution using yourt input on my challenge. In fact I was a bit overwhelmed by the complexity of especially the references to hierachies and INSCOPE functions. 

 

After a lot of searching and reading through a lot more of complex solution, I found a solution very deas imple as I was expected it to be. 

 

First I created the following formula:

 

#ShipmentsAllMethods = Calculate(Sum('table1'[Shipments]), ALL('table1'[Shipment_method])

 

Then I created a conditional data color formatting, where if the value is between 0-30 light pink, when value > 30 white.

 

I did the same for creating graphs with other categories like payment_method or shipment_country.

 

Hope this simple solution will help others with the same problem. 

 

Again, many thanks guys!

View solution in original post

5 REPLIES 5
Tjeerd
Frequent Visitor

Hi all,

 

First of all thank you for your your replies and the time you put into my challenge!

I did not came directly to the solution using yourt input on my challenge. In fact I was a bit overwhelmed by the complexity of especially the references to hierachies and INSCOPE functions. 

 

After a lot of searching and reading through a lot more of complex solution, I found a solution very deas imple as I was expected it to be. 

 

First I created the following formula:

 

#ShipmentsAllMethods = Calculate(Sum('table1'[Shipments]), ALL('table1'[Shipment_method])

 

Then I created a conditional data color formatting, where if the value is between 0-30 light pink, when value > 30 white.

 

I did the same for creating graphs with other categories like payment_method or shipment_country.

 

Hope this simple solution will help others with the same problem. 

 

Again, many thanks guys!

View solution in original post

v-lili6-msft
Community Support
Community Support

hi  @Tjeerd 

For your case, adjst the rule measure as below:

Morethan 30 = IF(CALCULATE([#shipments],FILTER(ALLSELECTED('Table'),'Table'[Level1]=MAX('Table'[Level1])))>30,1,0)

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

Thank you for your answer. Really think this is into the right direction. I have a question however. What do I fill in for [Level1]? What does that include? Do I have to fill in the column I don't want to filter? 

And, what if there are two columns I want to exclude from filtering? Do I have to make a seperate measurement for that? 

 

 

Thank you in advance!

 

BR Tjeerd

hi  @Tjeerd 

If so, you need make a seperate measurement for that, then use ISINSCOPE function to create a IF measure for them

https://xxlbi.com/blog/new-dax-function-isinscope/

 

if you still have the problem, please share your sample pbix file and your expectedoutput.

 

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Tjeerd , refer this can help

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors