Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
I have a table from where I want to use some columns for a Clustered Bar visual.
The columns are like this:
| 24hs | 48hs | 72hs | 7 days |
| True | True | True | True |
| False | False | False | False |
| False | False | False | False |
| True | True | True | True |
| False | False | False | False |
I want to create a Clustered Bar Chart so each cluster is one of those columns (24hs would be one cluster, with True and False being each of the bars). However I can't find a way of add the data to the visual and show all the different columns. It always shows the first column.
So I'm thinking that maybe I need to remodel the data to something like this:
| Frequence | TRUE | FALSE |
| 24hs | 2 | 3 |
| 48hs | 2 | 3 |
| 72hs | 2 | 3 |
| 7 days | 2 | 3 |
But neither I know if that would work nor how to create the new table.
Can you help me?
@Anonymous , Already couple of good solution around M.
Refer Dax Solution
union(
summarize(table,"Frequence","24hs","True",coutrows(filter(Table,table[24hs]="True")),"Fales",coutrows(filter(Table,table[24hs]="False")))
,summarize(table,"Frequence","48hs","True",coutrows(filter(Table,table[48hs]="True")),"Fales",coutrows(filter(Table,table[48hs]="False")))
,summarize(table,"Frequence","72hs","True",coutrows(filter(Table,table[72hs]="True")),"Fales",coutrows(filter(Table,table[72hs]="False")))
,summarize(table,"Frequence","7 days","True",coutrows(filter(Table,table[7 days]="True")),"Fales",coutrows(filter(Table,table[7 days]="False")))
)
Also refer unpivot
Hi @Anonymous ,
It is not necessary to transform the data into what you mentioned. There is an easy way.
1. In Power Query Editor, select all columns and Unpivot Columns.
2. In Power BI Desktop, create a Clustered Bar visual.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Follow the following steps:
1. The raw data is as follows in Query Editor:
2. Select all the columns as follows and "UNPIVOT Columns Icon":
Once you unpivot data, you get following:
3. Add 2 cutsom columns as follows:
You will get the following:
4. Select "Attribute" column (in my case) and then click "GROUP BY" at the top as shown below with the settings:
5. You will get the desired output as follows:
You can then try creating your clustered bar chart.
I tried something as follows:
If this helps please give Kudos and mark it as a Solution! 🙂
Thanks,
Pragati