Forum Discussion

sps-reporter's avatar
sps-reporter
Helper II
6 years ago
Solved

Complex Calculations in Measure table

I am relatively new to Power BI and have gotten in over my head. I like that it is easy to basic tasks but stuck on more complex calculations. I am trying to analyze a production system where people work on two shifts (Day,Night) and produce widgets. I would like to compare shift average widget production to individual shift average production then normalized by the number of shifts each person worked as compared to the average hours work against individual hours worked. Here is a sample production log:

 

I can get the result that I want but my model is probably too messed up since the result does not change when I change the date

 

This is my model:

Widget Data Model

I'm not asking anyone to solve this problem for me but would be interested in anyone pointing out bad habits or recommend a path to good practices. Thanks

  • parry2k's avatar
    parry2k
    6 years ago

    sps-reporter there are many external tools available to document power bi files. Here is such a tool.

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

     

     

9 Replies

  • sps-reporter model looks ok to me but you are missing date dimension, As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

    https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-calculations/

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi sps-reporter ,

     

    Didn't find any thing through the screenshot, better to share you pbix to us if you don't have any Confidential Information.

     

    Best Regards,

    Jay

    • sps-reporter's avatar
      sps-reporter
      Helper II

      Thanks, I could share the PBIX file. The data is sanitized and from an Excel Spreadsheet. I can see how to up load the file. I have a Pro license but it is not letting create a embed link. What is the best way to share a PBIX file with the forum?

      Thanks

    • sps-reporter's avatar
      sps-reporter
      Helper II

      Thanks for your reply. I am still banging my head on this. I get the correct answers when all the dates are selected but when I choose a subset of the data by date the answers are wrong and it appears most of the measures are still be calculated on all dates. Here is my PBIX file.

      I bet there is something simple that I am missing because it seems power bi is built to do these types of calculations

      Any tips would be great.

      Thanks