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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Transposing columns for a stack chart

Given this data:

 

Project   Score1   Score2   Score3

a                  1          0            1

b                  0          1            0

c                  0          0            1

 

I'd like to transpose the scores to get their pass/fail rate as the following:

 

stackchart.PNG

Do I need to create an intermediate table/view or how could I do the grouping?

Thanks!

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

Do you want to calculate the percentage of the o and 1 for the Score1, Score2, Score3?

If it is, you could unpivot your Score X columns in Query editor firstly and then create the measure below?

0 =
CALCULATE (
    COUNTROWS ( 'Table2' ),
    FILTER (
        'Table2',
        'Table2'[Value] = 0
            && 'Table2'[Score] = MAX ( 'Table2'[Score] )
    )
)
    / COUNTROWS ( 'Table2' )
1 =
CALCULATE (
    COUNTROWS ( 'Table2' ),
    FILTER (
        'Table2',
        'Table2'[Value] = 1
            && 'Table2'[Score] = MAX ( 'Table2'[Score] )
    )
)
    / COUNTROWS ( 'Table2' )

Here is the output.

Capture.PNG

You also could have a reference of my attachement.

If I misunderstood your logic, please decribe your logic in more details.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please feel free to ask.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

Do you want to calculate the percentage of the o and 1 for the Score1, Score2, Score3?

If it is, you could unpivot your Score X columns in Query editor firstly and then create the measure below?

0 =
CALCULATE (
    COUNTROWS ( 'Table2' ),
    FILTER (
        'Table2',
        'Table2'[Value] = 0
            && 'Table2'[Score] = MAX ( 'Table2'[Score] )
    )
)
    / COUNTROWS ( 'Table2' )
1 =
CALCULATE (
    COUNTROWS ( 'Table2' ),
    FILTER (
        'Table2',
        'Table2'[Value] = 1
            && 'Table2'[Score] = MAX ( 'Table2'[Score] )
    )
)
    / COUNTROWS ( 'Table2' )

Here is the output.

Capture.PNG

You also could have a reference of my attachement.

If I misunderstood your logic, please decribe your logic in more details.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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 Solution Authors