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

Join 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.

Reply
Anonymous
Not applicable

Calculating counts and % of entries from multiple columns

Hi All,

I have a dataset like this:

DateUserLevel 1Level 2Level 3
3-24-2021bobbad n/a
3-25-2021chipgoodbadgood
3-26-2021terrybadworsebad
3-27-2021bobbadbad 
3-28-2021timbadgood 


Which I need to talley each category of feedback from multiple columns, but I'm having some issues getting them to count properly, since they are sharing rows. What I'm going for is to have a visual show something like this:

FeedbackCountShare %
n/a18.3%
good325.0%
bad758.3%
worse18.3%


I'm able to get tallys working, but only for one "Level" at a time, since it's counting entries from the other levels that have something on the same row whenever I try to count from all three columns at once. I tried making a pivot table, but it didn't work out well since I also need to be able to still slice by User and Date.

Where do I begin making measures for Count and % to deal with this dataset?

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @Anonymous ,

 

create a new table to get distinct values for the Feedback:

Feedback = 
DISTINCT(
    UNION(
        VALUES( myTable[Level 1] ),
        VALUES( myTable[Level 2] ),
        VALUES( myTable[Level 3] )
    )
)

 

Rename the column [Level 1] to [Levels] in the new table Feedback.

In case the table you posted first is called myTable add the following measure:

Count =
    CALCULATE(
        COUNTROWS( myTable ),
        TREATAS( SUMMARIZE( Feedback, Feedback[Levels] ), myTable[Level 1] )
    )
    +
    CALCULATE(
        COUNTROWS( myTable ),
        TREATAS( SUMMARIZE( Feedback, Feedback[Levels] ), myTable[Level 2] )
    )
    +
    CALCULATE(
        COUNTROWS( myTable ),
        TREATAS( SUMMARIZE( Feedback, Feedback[Levels] ), myTable[Level 3] )
    )

 

This should give you the result you want:

12.png

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

3 REPLIES 3
selimovd
Super User
Super User

Hey @Anonymous ,

 

create a new table to get distinct values for the Feedback:

Feedback = 
DISTINCT(
    UNION(
        VALUES( myTable[Level 1] ),
        VALUES( myTable[Level 2] ),
        VALUES( myTable[Level 3] )
    )
)

 

Rename the column [Level 1] to [Levels] in the new table Feedback.

In case the table you posted first is called myTable add the following measure:

Count =
    CALCULATE(
        COUNTROWS( myTable ),
        TREATAS( SUMMARIZE( Feedback, Feedback[Levels] ), myTable[Level 1] )
    )
    +
    CALCULATE(
        COUNTROWS( myTable ),
        TREATAS( SUMMARIZE( Feedback, Feedback[Levels] ), myTable[Level 2] )
    )
    +
    CALCULATE(
        COUNTROWS( myTable ),
        TREATAS( SUMMARIZE( Feedback, Feedback[Levels] ), myTable[Level 3] )
    )

 

This should give you the result you want:

12.png

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 
Anonymous
Not applicable

How would I go about getting the % share of each item over the total of all feedback?

Anonymous
Not applicable

That worked perfectly!
Exactly the funtionality i was looking for-
The slicers also worked seemlessly.

Thanks a bunch!

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.