Forum Discussion

eugenm's avatar
eugenm
Icon for Helper II rankHelper II
5 years ago
Solved

Banding not working when selecting specific dates

Hi folks,

 

A visual and a mock pbix of what I have to solve are linked here: Visual and here: PBIX .

Target: 

  1. For each MAC and a selected number of days sum up the number of units for each entry in the MAC colum.
  2. Chart the resulting data using band/ buckets of number of units on the X axis and the number of MAC's in each bucket in the Values.

The issue: I can successfully perform #1 until I add the bands, which breaks up the data for each MAC, per day, instead of placing the units total in a # of units bucket.

The attached should clearly explain my issue and the desired outcome.

I really hope that someone can help. I've been at this for quite a few days now...

 

Thanks

  • eugenm you cannot create binding using a slicer, the recommendation would be to create a separate table (disconnected table) for binding (pre-populated with all the range) and then use it for viewing the data.

     

     

  • eugenm because in Totals you gave the value of -1, remove it

     

    Totals = 
    IF(ISNUMBER(MAX('RAW'[Units])),CALCULATE(SUM('RAW'[Units])))
    

     

    Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

11 Replies

  • eugenm because in Totals you gave the value of -1, remove it

     

    Totals = 
    IF(ISNUMBER(MAX('RAW'[Units])),CALCULATE(SUM('RAW'[Units])))
    

     

    Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

    • eugenm's avatar
      eugenm
      Icon for Helper II rankHelper II

      Ouch, yes, indeed - I forgot about that when creating the mock data from my actual, way more convoluted data set. 
      Much appreciated. Thanks

    • eugenm's avatar
      eugenm
      Icon for Helper II rankHelper II

      Apologies, looks like there is still one last step that it's not complete: charting based on the count of instances a row/ MAC falls under a certain bucket. 

      Basically I need to sum up the numbers under the 0-15, 30-45, 45-60, etc and used as values in a chart with the respective buckets on the X Axis. 
      Since this table is a visual one, can I do that? Doesn't seem to be the case. 
      How can I achieve this?

      Using MAC's as a legend does not work as I need a regular bucket with a count of MAC's - one color, sum of counts, as I will have to be able to drill down to the data, to see all the MAC's that are in that band/bucket.

      Here's the updated pbix.
      I'd appreciate your help once more... TIA


      • eugenm's avatar
        eugenm
        Icon for Helper II rankHelper II

        parry2k , if it possible to achieve what I am indicating in my latest post? That charting issue is what caused my issues in the first place. I had a different way of achieving everything here, but bumped into the same issue - an inability to chart with the banding groupd on the X axis and the number of MAC instances that fit into each band.

  • eugenm you cannot create binding using a slicer, the recommendation would be to create a separate table (disconnected table) for binding (pre-populated with all the range) and then use it for viewing the data.

     

     

    • eugenm's avatar
      eugenm
      Icon for Helper II rankHelper II

      I see. That is odd -  a PBI limitation AFAIK.

      I have adjusted the mock PBIX and it's almost done. 

      I just don't understand why I have -1's all over the place, in my matrix.

      Any idea?

  • eugenm  try this measure

     

    Banding2 = 
    
    SUMX ( 
        VALUES ( RAW[MAC] ), 
        VAR __total = [Totals]
        RETURN
            IF ( __total >= MAX ( UnitBands[Min] ) && __total <= MAX ( UnitBands[Max] ), 1 ) 
    )

     

    Check my latest blog post Improve UX: Show Year in Legend When Using Time Intelligence Measures | PeryTUS IT Solutions  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

    • eugenm's avatar
      eugenm
      Icon for Helper II rankHelper II

      Thank you parry2k.
      Not sure why, but there are no results returned by the new Banding Measure. As well, wouldn't this still not work? I need the count of instances fitting into each band on the X axis. If I am still using a measure I would not be able to place the results on the X axis. Or am I missing something?

    • eugenm's avatar
      eugenm
      Icon for Helper II rankHelper II

      It works indeed. Thank you very much. All done now.