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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
MTTsoftwareuser
Frequent Visitor

Summing Data from One Column Based on Text in Other Column

Hi All,

 

I have three columns in a table that I am considering - Hours, Has WO, and Multiple WO.  I'm trying to create a measure that will calculate the Hours for records where Has WO = Yes AND Multiple WO = Multiple and then divide that by the Hours for records where Has WO = Yes.  In the attached pic, the calculations would wind up being 35.5 / 120.

 

mult.jpg 

 

I'm using this as my measure:

 

Chart 4b = DIVIDE(CALCULATE(SUM ('Data'[Hours]),'Data'[Has WO] = "YES"),CALCULATE(SUM ('Data'[Hours]),'Data'[Has WO] = "YES",'Data'[Multiple WO] = "MULTIPLE"))
 
But my result in PBI is this
pbi4b.jpg
I know it's not working because the results aren't percentages and aren't converting to percentages - something tells me it's doing some summing but not division.  
 
Thanks in advance!
 
Gregg

 

6 REPLIES 6
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

based on your description and then measure -  it looks like measure is dividing the total by the amount rather than how it was described above.

 

i've tried this and it'w working:

 

Measure = DIVIDE(CALCULATE(SUM('Table (2)'[Hours]),'Table (2)'[Has WO]="Yes",'Table (2)'[Multiple WO]="Multiple"),CALCULATE(SUM('Table (2)'[Hours]),'Table (2)'[Has WO]="Yes"))
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

How do I share a download link here @Ashish_Mathur 

Hi,

Upload the file to Google Drive and share the download link here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Access Denied message.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.