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
JRF_PowerBI
Frequent Visitor

Calculating measures based on another measure

Hi

 

New to Power BI and this forum, so apologies if there is an obvious solution to this, but couldn't find it anywhere on existing forum threads.

 

I have calculated two measures from 2 separate data tables - 'Hours Delivered' and 'Minimum Staff Hours'. Both use dates (I have a separate date table) and Locations as dimensions that appear in both source tables. I've then created a third measure - Safe Staffing Level? - which is a simple if statement returning "Yes" if HoursDelivered is greater than or equal to MinimumStaffHours; and "No" if its less. This means I can create a table in the visualisation pane showing staffing levels at each of our Locations, which looks like this:

Table_image.PNG

So far so good. I now want to create some rolled up measures that give me a count and percentage of days in any given month that each Location had a safe staffing level (i.e. based on a count of dates where Safe Staffing Levels? = "Yes"). Is this possible? Am I on the right lines with what I've done so far, or am I approaching this all wrong?!

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @JRF_PowerBI ,

 

Sounds like possible but will need confirmation. We can't help with this without sample data. So if you need us to help deal with Dax, please share some sample data and expceted result.

 

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.
Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.  Also, show the exact result that you are expecting for a few sample months/locations.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

You're generally on the right track. Just keep in mind that measures usually involve context transitions, and using one measure inside another may be risky at times when these transitions conflict.  Better to create new measures for each particular question your want answered.

 

Generally you want to design measures in a way that they work for the subtotals and grand total. Then most of the time they will work fine for the individual display items, and for other filters. The reverse is seldom true.

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.