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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
PowerMoon
Frequent Visitor

Help with proportions and select all questions

Hi

I am trying to report the proportions of participants who selected each value (diverts attention, staff hours, etc.) among all everyone who selected a particular attribute. Survey participants were instructed to ‘select all’ that apply, so the proportions do not add up to 100%.

 

The denominator is different for each attribute depending on an answer to a previous question. Data come from an unpivoted table.

 

Thanks in advance!

 

PowerMoon_0-1665372082133.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PowerMoon ,

 

Please try:

Proportion = 
VAR _each =
    COUNTROWS ( 'Table' )
VAR _total =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        ALL ( 'Table'[Attribute.1] ),
        ALL ( 'Table'[Value] )
    )
VAR _rate =
    DIVIDE ( _each, _total )
RETURN
    _rate

vcgaomsft_0-1665537682984.png

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

View solution in original post

8 REPLIES 8
PowerMoon
Frequent Visitor

Thanks, Gao. The denominator is all who selected an attribute in a previous question rather than the whole table. Is that possible?

Anonymous
Not applicable

Hi @PowerMoon ,

 

Understand, it seems unlikely.😔 These calculations are based on the current context, and once the slicer changes, the context changes as well.

 

Best Regards,
Gao

Community Support Team

OK thanks 🙂

PowerMoon
Frequent Visitor

Thanks, here's a screenshot of the data

(sorry if I misunderstood your question)

PowerMoon_2-1665376524242.png

 

 

 

 

 

Anonymous
Not applicable

Hi @PowerMoon ,

Please try this measure:

Proportion =
VAR _each =
    COUNTROWS ( 'Table' )
VAR _total =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        ALLSELECTED ( 'Table'[Attribute.1] ),
        ALL ( 'Table'[Value] )
    )
VAR _rate =
    DIVIDE ( _each, _total )
RETURN
    _rate

vcgaomsft_0-1665466083504.png

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

Thanks, Gao

 

I think this is on the right track, but the proportions should not add up to 100% as people could 'select all that apply'.  Thanks for replying!

Anonymous
Not applicable

Hi @PowerMoon ,

 

Please try:

Proportion = 
VAR _each =
    COUNTROWS ( 'Table' )
VAR _total =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        ALL ( 'Table'[Attribute.1] ),
        ALL ( 'Table'[Value] )
    )
VAR _rate =
    DIVIDE ( _each, _total )
RETURN
    _rate

vcgaomsft_0-1665537682984.png

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

amitchandak
Super User
Super User

@PowerMoon ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors