Forum Discussion

Tjeerd's avatar
Tjeerd
Helper I
6 years ago
Solved

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

  • 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!

5 Replies

  • v-lili6-msft's avatar
    v-lili6-msft
    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

    • Tjeerd's avatar
      Tjeerd
      Helper I

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