Forum Discussion
Data handling help
- 4 years ago
Hi krislives42 ,
If there are multiple answer columns and you don't want to create a separate measure for each column. Then first you need to unpivot all answer columns in Power Query Editor.
Then please create these measures.
Total Number of N's = CALCULATE ( COUNT ( 'Table'[Value] ), VALUES ( 'Table'[Attribute] ), FILTER ( ALL ( 'Table' ), 'Table'[Value] = "N" ) )Percentage of N's against total audits conducted = DIVIDE ( [Total Number of N's], CALCULATE ( COUNT ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Attribute] ) ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi krislives42 ,
Please create these measures.
Total Number of N's =
CALCULATE (
COUNT ( 'Table'[answer] ),
FILTER ( ALL ( 'Table' ), 'Table'[answer] = "N" )
)Percentage of N's against total audits conducted =
DIVIDE ( [Total Number of N's], COUNTX ( ALL ( 'Table' ), 'Table'[answer] ) )
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi v-kkf-msft ,
Thank you very much for taking the time to send that across. Building on that, what if that same example had multiple answer columns. Answer, Answer 1, Answer 2 etc.
Would I need an individual measure for each column, or is there something similar to ForEach, that would then run for me?
Again, huge thanks already for taking the time to help.
- v-kkf-msft4 years agoCommunity Support
Hi krislives42 ,
If there are multiple answer columns and you don't want to create a separate measure for each column. Then first you need to unpivot all answer columns in Power Query Editor.
Then please create these measures.
Total Number of N's = CALCULATE ( COUNT ( 'Table'[Value] ), VALUES ( 'Table'[Attribute] ), FILTER ( ALL ( 'Table' ), 'Table'[Value] = "N" ) )Percentage of N's against total audits conducted = DIVIDE ( [Total Number of N's], CALCULATE ( COUNT ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Attribute] ) ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- krislives424 years agoRegular Visitor
Absolutely brilliant v-kkf-msft ,
Thank you so much for helping me out on that one. Big thumbs up and accepted as a solution 100%.
Many thanks,