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
sps-reporter
Helper II
Helper II

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

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

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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
v-jayw-msft
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 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

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.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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.

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.

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.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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, this is what I was looking for. Looks like DAX Studio has a similar function as well.

parry2k
Super User
Super User

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



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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.

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.

Top Solution Authors