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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
JML5525
Regular Visitor

Power query percent of category total by date

Hello, I am in need of assistance. I have a table that I would like to calculate the percent of a category total by date in power query. The table is structured similar to the following:

 

JML5525_1-1697487098610.png

 

I would like to have another column for the percentage of total by category and date. Category being building. For example, the first row column would be calculated as 100 (units on 10/1/2023 for machine 1 building 1) /300 (total units made in building 1 on 10/1/2023) The result would be .33. The second row would be  200(units on 10/1/2023 for machine 2 building 1)/300 (total units made in building 1 on 10/1/2023)resulting in .66. Can anyone help? I am having trouble adding up all the units in the building per day and then dividing the units made by machine per units in the building each day.  Thank you. 

1 ACCEPTED SOLUTION
watkinnc
Super User
Super User

After turning the units into numbers, you can group by date, and sum the units, also, choosing the all rows aggregation. Then expand the table column, after which you can just do the row math.

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

View solution in original post

2 REPLIES 2
watkinnc
Super User
Super User

After turning the units into numbers, you can group by date, and sum the units, also, choosing the all rows aggregation. Then expand the table column, after which you can just do the row math.

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

Thank you this worked perfect!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors
Top Kudoed Authors