Forum Discussion
Creating Percentage measure in Power BI
- 6 years ago
Hi asah0977 ,
Suppose you have another table
You can use the following measure:
Measure = CALCULATE(COUNT('Table'[Student ID ]),FILTER(ALL('Table'),'Table'[Room Location] = MAX('Table'[Room Location])))/CALCULATE(VALUES(Table2[Total number of residents in each residents ]),FILTER(Table2,Table2[Room Location] = MAX('Table'[Room Location])))Please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EdGomEXwzNpFs_pvH8d_AoMB37bKrbSI75CXGn9jNspmAQ?e=FHXErB
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
asah0977 , Try
divide(sum(table[resident),calculate(sum(table[resident), allselected(Table)))
or
divide(sum(table[resident),calculate(sum(table[resident), all(Table)))
In data format, you can mark as %, no need to multiply by 100
- asah09776 years agoNew Member
Hi Amit,
Thank you for your prompt reply. My Table is below. Column A and Column B are part of the data set.
Student ID Room Location Total number of residents in each residents 2345 Queen Mary Queen Mary = 100 45678 Regiment Regiment = 60 3456 Abercrombie Abercrombie = 30 6432 Queen Mary 3579 Regiment 9876 Abercrombie Column C is not part of the data set. Basically, I need to find Queen Mary = 2/100 * 100 = 2% occupancy. it's the same for Regiment and Abercrombie too.
Thanks,
Anirudha
- v-deddai1-msft6 years ago
Community Support
Hi asah0977 ,
Suppose you have another table
You can use the following measure:
Measure = CALCULATE(COUNT('Table'[Student ID ]),FILTER(ALL('Table'),'Table'[Room Location] = MAX('Table'[Room Location])))/CALCULATE(VALUES(Table2[Total number of residents in each residents ]),FILTER(Table2,Table2[Room Location] = MAX('Table'[Room Location])))Please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EdGomEXwzNpFs_pvH8d_AoMB37bKrbSI75CXGn9jNspmAQ?e=FHXErB
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai