Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
colinryan
Regular Visitor

I have multiple columns of the same type of data in a Power BI dataset

Hello, 

 

I have 3 columns for genre data in a Power BI dataset and I want to create a chart that shows those columns as a single data point,

 

Screenshot 2024-07-18 032250.png

 

I want to count all three as a single data point in charts like this bar graph

 

Screenshot 2024-07-18 032530.png

 

how should I go about it?

 

Thank you!

3 REPLIES 3
Anonymous
Not applicable

Hi @colinryan ,

I create a table as you mentioned.

vyilongmsft_0-1721280918036.png

Then I create a new table and here is the DAX code.

Table 2 = 
SUMMARIZE(
    FILTER(
        UNION(
            SELECTCOLUMNS('Table', "Number", 'Table'[Genre1]),
            SELECTCOLUMNS('Table', "Number", 'Table'[Genre2]),
            SELECTCOLUMNS('Table', "Number", 'Table'[Genre3])
        ),
        [Number] <> BLANK()
    ),
    [Number],
    "Frequency", COUNTROWS(FILTER(
        UNION(
            SELECTCOLUMNS('Table', "Number", 'Table'[Genre1]),
            SELECTCOLUMNS('Table', "Number", 'Table'[Genre2]),
            SELECTCOLUMNS('Table', "Number", 'Table'[Genre3])
        ),
        [Number] = EARLIER([Number]) && [Number] <> BLANK()
    ))
)

vyilongmsft_1-1721281409455.png

Finally you will get what you want.

vyilongmsft_2-1721281479606.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

danextian
Super User
Super User

Hi @colinryan ,

 

You need to transform your data so you only have one column for the three genre columns. In Power Query, select the title column, right click and then select unpivot other columns which will create two new columns - attribute and value. Rename them as desired. Create a measure to count the distinct titles ( use DISTINCTCOUNT function). Use the value column and newly created measure in your visual.

danextian_0-1721278173519.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Sorry I forgot to include, I also have a column for their respective gross profits. Won't unpivoting columns affect the totals of the gross profit column upon visualizing?

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors