cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
deadlycapybara7 Frequent Visitor
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 ACount B% of GT of Count A + B
1172682.14%
2610134317.44%
33016286852.55%
41779129827.48%
522220.39%
Total55995599100.00%
1 ACCEPTED SOLUTION

Accepted Solutions
Twilla Frequent Visitor
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.

View solution in original post

2 REPLIES 2
Twilla Frequent Visitor
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.

View solution in original post

v-ljerr-msft Super Contributor
Super Contributor

Re: % GT over two columns

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. Smiley Happy

 

Regards

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

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.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 55 members 1,220 guests
Please welcome our newest community members: