cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

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:

Annotation 2020-07-28 083729.png

 

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

 

Annotation 2020-07-28 083633.png

This is my model:

Widget Data ModelWidget 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

1 ACCEPTED SOLUTION

Accepted Solutions

@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.

 

 






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

9 REPLIES 9
Super User IV
Super User IV

@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-ca...

 

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.






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Community Support
Community Support

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

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution to help the other members find it.

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 share it using one drive/google drive.

 

 






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Thanks after some head banging I got it figured out. I was making this more complicated than I needed to. I was thinking in terms of tables when measures were needed. For those who find this afterwards maybe this PBIX will help. Appreciate any comments that one might have on this.

Oh, is there a way to safe the "under the hood" DAX expressions, for measures and tables, to a file?

Thanks

@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.

 

 






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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Thanks, this is what I was looking for. Looks like DAX Studio has a similar function as well.

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

I added a date table to my model but I am still getting the wrong answers Here is my PBIX file. When I slice by a date the calculations are still be done over all the data. I need to be able to show a table and graph like the one in this PBIX file in my working model. This example is just one that can be easily verified.
Thanks, really appreciated any advice.

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors