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
frenchbrian
New Member

divide two number columns over a period of time

Hello, I am fairly new to DAX and trying to do somethign which seems fairly simple, but I am stumbling all over myself. I have two numeric columns in the same table:

 

hoursWorked - whole number (part of imported data)

possibleHours - whole number (calculated and filtered column)

 

What I am trying to figure out is the number of hours worked over a period of time vs. the amount of possible hours that could have been worked. This is known as Utilization. It should be a percentage.

 

I am able to add a Utilization column (Calculated Column: hoursWorked/possibleHours) which gives me the correct percentage per day. However, when I try to do any type of calculation over time such that I might be able to say for the month of January utilization was X%, I just can't get things to behave right. I do have a fully developed Date Dimension.

 

The attached picture is the primary table I am trying to work with.

 

TimecardTable.png

3 REPLIES 3
v-caliao-msft
Employee
Employee

Hi @frenchbrian,

 

In your scenario, the percentage total row not show correct value, right?

 

If that is the case, please check if the links below help or not.
https://community.powerbi.com/t5/Desktop/Row-percent-based-on-row-total-in-a-matrix/td-p/87544
http://community.powerbi.com/t5/Desktop/Grouped-percentage-of-row-total/m-p/33100

 

Regards,

Charlie Liao

Hi Charlies

 

Those links do look like they have potential; thanks for posting them.. Quite honestly, I have not been able to get back to looking at this for a bit of time. I plan on picking it up again at the end of this week. I will try out the suggestions in depth then.

BhaveshPatel
Community Champion
Community Champion

Hi There,

 

You should try creating a measure which would give you the correct aggregation or you can use SUMX ffunction to create the aggregation logic based on the columns you mentioned here.

 

Hope this helps. Let me know if you get stuck.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

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.

Users online (1,907)