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
Ouarda
New Member

Survey - How to create '% of Total for Questions' measure?

Hi, I'm analysing a survey and I need to create a new measure for % of Total for Questions so that it would show me the percentage of all answers for THIS question (not ALL questions).

 

This is what I have:

 

survey.JPG

 

and this is what I need (it's a screenshot from a youtube tutorial):

 

survey 2.JPG

 

I know she has a dax formula in there but I can't figure out how to adjust it to my columns.

 

Any help would be greatly appreciated, I have spent too much time trying to solve it and I really need to move on now.

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Ouarda ,

If I understand you wrongly, please provide simple data or a .pbix file without sensitive data.

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

The Table data is shown below:

vzhouwenmsft_0-1724224278678.png

Use the following DAX expression to create a measure

Measure = 
VAR _total_responses_for_one_question = CALCULATE(SUM('All Suveys Data'[Count of responses]),ALL('All Suveys Data'[Answer Options]))
VAR _response = SELECTEDVALUE('All Suveys Data'[Count of responses])

RETURN DIVIDE(_response,_total_responses_for_one_question)

Final output

vzhouwenmsft_1-1724224332597.png

 


Best Regards,
Wenbin Zhou

View solution in original post

mark_endicott
Super User
Super User

@Ouarda - Here's the DAX you need for your table, please put it into a measure:

 

VAR _count =
    SUM ( 'All Surveys Data'[Count of responses] )
VAR _question =
    SELECTEDVALUE ( 'All Surveys Data'[Question] )
VAR _responses =
    CALCULATE (
        _count,
        REMOVEFILTERS ( 'All Surveys Data' ),
        'All Surveys Data'[Question] = _question
    )
RETURN
    DIVIDE ( _count, _responses )

 

This works because the _count variable is filtered by the Filter Context of the 'Answer Options' column, whereas the _responses variable has this context removed, and the context of the question total is applied instead. 

 

If this works for you, please accept as the solution for the visibility of others. 

View solution in original post

2 REPLIES 2
mark_endicott
Super User
Super User

@Ouarda - Here's the DAX you need for your table, please put it into a measure:

 

VAR _count =
    SUM ( 'All Surveys Data'[Count of responses] )
VAR _question =
    SELECTEDVALUE ( 'All Surveys Data'[Question] )
VAR _responses =
    CALCULATE (
        _count,
        REMOVEFILTERS ( 'All Surveys Data' ),
        'All Surveys Data'[Question] = _question
    )
RETURN
    DIVIDE ( _count, _responses )

 

This works because the _count variable is filtered by the Filter Context of the 'Answer Options' column, whereas the _responses variable has this context removed, and the context of the question total is applied instead. 

 

If this works for you, please accept as the solution for the visibility of others. 

Anonymous
Not applicable

Hi @Ouarda ,

If I understand you wrongly, please provide simple data or a .pbix file without sensitive data.

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

The Table data is shown below:

vzhouwenmsft_0-1724224278678.png

Use the following DAX expression to create a measure

Measure = 
VAR _total_responses_for_one_question = CALCULATE(SUM('All Suveys Data'[Count of responses]),ALL('All Suveys Data'[Answer Options]))
VAR _response = SELECTEDVALUE('All Suveys Data'[Count of responses])

RETURN DIVIDE(_response,_total_responses_for_one_question)

Final output

vzhouwenmsft_1-1724224332597.png

 


Best Regards,
Wenbin Zhou

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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