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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Kelsey024
Frequent Visitor

Percent between 2 columns

Hello,

I am having some trouble with calculating a percentage between 2 values in 2 different columns. I want to get the percentage of gallons consumed by the water target for that specific location. The '% of Target Used' is the column I want.

This is what I want (in Excel):

PBI %.png


How do I get the same to work in Power BI? 

Everytime I try to divide the consumption by the water target I am getting an incorrect percentage. 

If anyone has a quick solution to this problem or why I am having such a hard time in PBI, I would very much appreciate it!

Thank you!

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi Kelsey024,

 

Create a measure in your table using DAX below:

% of Water Target Used =
DIVIDE ( [Consumption], [WATER TARGET] )

Then change the format of [% of Water Target Used] to percentage.

 

Regards,

Jimmy Tao

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi Kelsey024,

 

Create a measure in your table using DAX below:

% of Water Target Used =
DIVIDE ( [Consumption], [WATER TARGET] )

Then change the format of [% of Water Target Used] to percentage.

 

Regards,

Jimmy Tao

Anonymous
Not applicable

Now I am getting this error:
"A single value for column 'Staff Count per Week' in table 'AggData' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."

 

My data is similar to the water usage data above where one column is the number of people in an office vs the number of employees assigned to that office.

 

The DAX I'm trying is 

% of Office Used = DIVIDE(AggData[Staff Count per Week], [Employees Office] )
 
AggData is the table


So this data does change throughout the columns so not sure how to fix this and get the desired result.

 

Any suggestions or help is appreciated.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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