Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Percentage of table across in Power Query

Hi,

 

I need to convert visualization in Tableau to Power BI as below; 

And my value for the percentage is not showing the correct number.

Picture1.png

So what I did in PBI is that I duplicate a table in the Power Query Editor and grouped rows to get the total of each Billed and Unbilled AR and the sum first. Then divide ([sum Billed AR]/[Total Billed AR])*100.

Picture2.png

But it didn't give me the correct amount.

 

I need to make sure that the calculation is able to calculate the percentage across the table instead of the columns' value.

 

Thanks.

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

You need to create the following measures:

% Billed =
SUM ( Table1[Billed AR (kUSD)] )
    / CALCULATE ( SUM ( Table1[Billed AR (kUSD)] ); ALL ( Table1[Month] ) )


% Unbilled =
SUM ( Table1[Unbilled AR (kUSD)] )
    / CALCULATE ( SUM ( Table1[Unbilled AR (kUSD)] ); ALL ( Table1[Month] ) )

I'm assuming that the 1,2,3,... is month, change it by the column name you have in your model.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

5 REPLIES 5
MFelix
Super User
Super User

Hi @Anonymous ,

 

You need to create the following measures:

% Billed =
SUM ( Table1[Billed AR (kUSD)] )
    / CALCULATE ( SUM ( Table1[Billed AR (kUSD)] ); ALL ( Table1[Month] ) )


% Unbilled =
SUM ( Table1[Unbilled AR (kUSD)] )
    / CALCULATE ( SUM ( Table1[Unbilled AR (kUSD)] ); ALL ( Table1[Month] ) )

I'm assuming that the 1,2,3,... is month, change it by the column name you have in your model.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Thanks @MFelix ,

 

this calculation works for DAX, but I'm trying to find any solutions that can be done in power query instead since I need to unpivot the value.

this is the requirement from the users.

 

 

Hi @Anonymous ,

 

One question what do you mean by unpivot the value?

 

Making the value on query editor will make it harder to re-use the value especcially because it's a % if you want to calculate it for overall values using a column on the query editor will not give you the expected result.

 

I'm assuming that your information on the query editor is with a table like:

Month - Billed - Unbilled

 

Can you add any additional information in order to help you better.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi @Anonymous,

 

Can you share how you have your table setup in the query editor? 

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi Felix,

 

I have a discussion with the product owner and she agreed to change to your solution.

 

Thanksss!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.