Forum Discussion
Multiple columns and values in Matrix
- 8 years ago
Here are the steps:
1. Added an index column to the PowerBI_Ready table.
2. Duplicated the table using 'Reference' option and renamed it PowerBI-Ready_Gender.
3. Unpivoted the PowerBI_Ready_Gender table.
4. Power BI will automatically create the relationship between these two tables using the Index column.
5. Add the below two Measures in the PowerBI_Ready_Gender table.
Male = CALCULATE(COUNT(PowerBI_Ready_Gender[Gender]), PowerBI_Ready_Gender[Gender]="Male", PowerBI_Ready_Gender[Value]>0)
Female = CALCULATE(COUNT(PowerBI_Ready_Gender[Gender]), PowerBI_Ready_Gender[Gender]="Female", PowerBI_Ready_Gender[Value]>0)
The result:
Download the Power BI file here.
Here are the steps:
1. Added an index column to the PowerBI_Ready table.
2. Duplicated the table using 'Reference' option and renamed it PowerBI-Ready_Gender.
3. Unpivoted the PowerBI_Ready_Gender table.
4. Power BI will automatically create the relationship between these two tables using the Index column.
5. Add the below two Measures in the PowerBI_Ready_Gender table.
Male = CALCULATE(COUNT(PowerBI_Ready_Gender[Gender]), PowerBI_Ready_Gender[Gender]="Male", PowerBI_Ready_Gender[Value]>0)
Female = CALCULATE(COUNT(PowerBI_Ready_Gender[Gender]), PowerBI_Ready_Gender[Gender]="Female", PowerBI_Ready_Gender[Value]>0)
The result:
Download the Power BI file here.
anandav, Thank you, it works. Your help is appreciated.