cancel
Showing results for
Did you mean:
Highlighted
deadlycapybara7 Frequent Visitor

% GT over two columns

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%
1 ACCEPTED SOLUTION

Accepted Solutions
Twilla Frequent Visitor

Re: % GT over two columns

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.

2 REPLIES 2
Twilla Frequent Visitor

Re: % GT over two columns

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.

v-ljerr-msft Super Contributor

Re: % GT over two columns

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

Announcements Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge. Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform. Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag. Top Kudoed Authors
Users Online
Currently online: 55 members 1,220 guests
Recent signins:
• ItSupportElm • epappu • Ronald_P • Marcusbja • Sjors • jochenj • • h0l01r6 • amirqaud • nlocklin99 • StevenRenders • srenders • tfaruq • ssumner 