Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I'm a complete novice on Power BI but I'm trying to combine two columns with similar data (e.g. 1-5) to create a GT% overall.
e.g. Count A contains different number of 1-5 data than Count B.
Count A | Count B | % of GT of Count A + B | |
1 | 172 | 68 | 2.14% |
2 | 610 | 1343 | 17.44% |
3 | 3016 | 2868 | 52.55% |
4 | 1779 | 1298 | 27.48% |
5 | 22 | 22 | 0.39% |
Total | 5599 | 5599 | 100.00% |
Solved! Go to Solution.
Hi,
Create a measure:
% of GT = sumx(Table1;Table1[Count A]+Table1[Count B])/calculate(SUM(Table1[Count A])+SUM(Table1[Count B]);all(Table1))
Replace table1 with the name of your table.
The sumx function takes the sum of count A and count B at row level.
The second part takes the sum of count A+count B for the whole table (it does this because we use a the "ALL" function which ignores the current context of the row. For you to understand the solution, search some info about the DAX functions: All, Calculate, SUM and SUMX.
Hi @deadlycapybara7,
Have you tried the solution provided by @Twilla above? Does it work in your scenario? If it works, could you accept it as solution to close this thread?
If you still have any question on this issue, feel free to post here.
Regards
Hi,
Create a measure:
% of GT = sumx(Table1;Table1[Count A]+Table1[Count B])/calculate(SUM(Table1[Count A])+SUM(Table1[Count B]);all(Table1))
Replace table1 with the name of your table.
The sumx function takes the sum of count A and count B at row level.
The second part takes the sum of count A+count B for the whole table (it does this because we use a the "ALL" function which ignores the current context of the row. For you to understand the solution, search some info about the DAX functions: All, Calculate, SUM and SUMX.
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |