Forum Discussion

Julian_Brunet's avatar
Julian_Brunet
New Member
4 years ago
Solved

Stop donut chart from separating values from different columns

Hi, everyone! I'm making my first report and I'm having issues with one small thing.

 

I have 5 columns that can contain 4 different values:

 

(They all look the same for now but will change soon)

So, I want to graph in a donut chart the amount of times these values repeat themselves, but when I do it, the donut chart gets separated according to the column:

 

How can I make the donut chart count how many of each category there are regardless of the column the came from?

 

Grretings,

Julián Brunet

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Julian_Brunet ,

     

    Based on the description, you can create four measures and place it as fields in the values of the donut chart.

    As an example, you need to replace the numbers in the formula.

    1 = 
    VAR _c1 = CALCULATE(COUNTROWS('Table'),'Table'[Column1] = "1")
    VAR _c2 = CALCULATE(COUNTROWS('Table'),'Table'[Column2] = "1")
    VAR _c3 = CALCULATE(COUNTROWS('Table'),'Table'[Column3] = "1")
    VAR _c4 = CALCULATE(COUNTROWS('Table'),'Table'[Column4] = "1")
    VAR _c5 = CALCULATE(COUNTROWS('Table'),'Table'[Column5] = "1")
    VAR _result = _c1+_c2+_c3+_c4+_c5
    RETURN
    _result

    The PBIX file is attached for reference.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Julian_Brunet ,

     

    Based on the description, you can create four measures and place it as fields in the values of the donut chart.

    As an example, you need to replace the numbers in the formula.

    1 = 
    VAR _c1 = CALCULATE(COUNTROWS('Table'),'Table'[Column1] = "1")
    VAR _c2 = CALCULATE(COUNTROWS('Table'),'Table'[Column2] = "1")
    VAR _c3 = CALCULATE(COUNTROWS('Table'),'Table'[Column3] = "1")
    VAR _c4 = CALCULATE(COUNTROWS('Table'),'Table'[Column4] = "1")
    VAR _c5 = CALCULATE(COUNTROWS('Table'),'Table'[Column5] = "1")
    VAR _result = _c1+_c2+_c3+_c4+_c5
    RETURN
    _result

    The PBIX file is attached for reference.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data

  • Hi,

    You can try unpivoting all the 5 columns together into one single column in the Power Query editor and then

    pulling the single unpivotted column into the Donut chart to give desired results.