Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |