Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Group values in column chart/bar chart

Hey All,
I want to grop the blanks value to another bar. Is it possible?
For example, I want that blanks will be counted with code 9. So blank will be removed from the chart and 9 will show 292 + 5 = 297.

 

Cheers!

  • Hi Anonymous ,

    By my tests, the solution of parry2k should be helpful.

    I have made a test pbix to reproduce your scenario.

    In addition, you could have a reference of the attachment.

    Best  Regards,

    Cherry

     

12 Replies

  • Anonymous you can add another column and use that on x axis

     

    New Code = IF( ISBLANK(Table[Code]), 9, Table[Code] )

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hey,

      That is more or less what I have done, but it is not working.
      Thia is my DAX:
      Code =
      IF(ISBLANK(Table[CODE]), "9",
      IF(Table[CODE] = "1", "1",
      IF(Table[CODE] = "2", "2",
      IF(Table[CODE] = "3", "3",
      IF(Table[CODE] = "4", "4",
      IF(Table[CODE] = "9" , "9",
      "Unknown")
      )))))

      • parry2k's avatar
        parry2k
        Super User

        Anonymous did you tried what I sent? Not sure why you have to have more if condition, i think ask is if blank then 9 else whatever the code value is, isnt it?

  • Hi,

    In the Table where you have dragged the Codes from, create this calculated column formula

    =IF(ISBLANK(Data[Codes]),9,Data[Codes])

    Hope this helps.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Ashish_Mathur ,
      Thanks.

      This was the first solution from parry2k .

      Please read previous comments.

      Thanks

      • parry2k's avatar
        parry2k
        Super User

        Anonymous I'm you surely checked this but can you use your actual data on x-axis and check if your see (blank) on x-axis or space/nothing, wondering if it is actually not blank but some other non-printed character value, although that would have been captured in switch statement.

         

        Just trying to think out of the box even it is not logical.