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

Grouping data and calculating a result

Please help me setup my Formulas to get what I am trying to achieve. I wish I could paste screen shots to help explain this but I cannot figure out how to do that.

 

I have 2 big data sources, that I am trying to cross reference to get an output result.

 

The first data source is Hours Worked.  This is a report that contains employee hours worked with tags for:

  1. date (day)
  2. WBS element (work code)
  3. Foreman Name
  4. Hours

hours sheet.JPG

The second data source is Quantity report.  This is a report stating what work was completed and contains some common tags as the hours report.  It has tags for:

  1. date (day)
  2. WBS element (work code)
  3. Foreman Name
  4. Quantity Earned
  5. Tag number (this identifies a component that is part of the WBS code.  For example, the WBS element could be "build walls", and the Tag number identifies the individual walls that make up the total WBS element.

qty report.JPG

The first step I want to do is group the data in both tables, by week.  I have setup a Calendar table to do this.

calendar.JPG

 

The second step I want to do is group into a table the following information from the Quantity report:

  • group the sum of "Quantity Earned" by
    • week
    • WBS element
    • Foreman Name
    • Tag number

Then next step I want to do is group the Hours from the Hours Worked report:

  • group the sum of "Hours" by
    • week
    • WBS element
    • Foremane Name

My modeled relationships look like this right now;

relationship.JPG

 

Once I have those grouped hours, I need to divide them by the Total Quantity earned in the table we made for the Quantity earned grouping (where the week/WBS element and foreman name match).  This result will be the hours per quantity earned, by week, by foreman and by WBS.

 

The final step is to then take that result of hours/Total quantity earned and multiply by all the Tag number quantities in the week - to get a reult of hours worked, by tag number (by week, WBS and foreman name).

 

I think I am very close - please help - let me know how I can show you my screen shots to help understand more what I am doing!

 

I have made 2 grouped tables (1 from each report) that I think might get me closer, but am not using them in my relationships yet.  Perhaps they could be used to help?  They look like this:Qty by wk-fm-wbs.JPG

 

Hrs by wk-fm-wbs.JPG

 

 

1 REPLY 1
Nathaniel_C
Super User
Super User

@scott_taylor ,

The best way is use the snipping tool and then post here using photos.photos.PNG

 

 

You can also copy and paste your table into Code above </>
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





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

Proud to be a Super User!




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.