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

How to create a measure to count another measure??

Hello all!

 

I am having a problem, I have a table that shows 5 columns.  The first 4 columns are actual dataset columns and the 5th is a measure.  The data table lists location IDs with and average start time and average end time by end of week.  The last column is the average variance between start and end however this is a measure and not a table column.  The location are to not have a variance of more than 15 minutes.  I need to create a measure that counts how many location made the variance goal of 15 or less for each week.  For the life of me I can't figure out how to pass the count of locations that made goal onto another calculation.  The person with the answer is a hero!!  Below is an example of the data table.  I want to be able to put the percentage out to the left of each section for the week.

 

DateCityAVG StartAVG EndAVG Variance % Compliant
3/14/2023ATL18:3018:4515  
 BOS18:1518:4530  
 JFK19:0520:0055  
 LAX21:3021:3363 62%
 SFO13:3013:4515 
 SEA14:3014:4515  
 MSP12:3012:4515  
 DTW17:0017:1515  
3/15/2023ATL8:008:1010  
 BOS9:159:205  
 JFK8:458:505  
 LAX12:0012:1515 75%
 SFO23:1023:3020 
 SEA22:0022:1010  
 MSP8:159:0045  
 DTW22:1522:205  
3/16/2023ATL15:0015:055  
 BOS12:0012:3030  
 JFK14:3014:4515  
 LAX14:1514:205 87%
 SFO19:0019:1010 
 SEA19:4519:505  
 MSP10:0010:055  
 DTW9:309:4515  
7 REPLIES 7
zraptor
Frequent Visitor

This is working great for the table itself but shows as 'BLANK' when dropped in a card.

show what kind of card and what result you expect

Ahmedx
Super User
Super User

if you need more than or equal to 15 then change here
Screen Capture #667.pngScreen Capture #668.png

 

Ahmedx
Super User
Super User

here are two measures that solve your problem. they both give the same result

if you need more than or equal to 15 then change here
FILTER ( 'Table', [AVG Variance] >= 15 )
1.png2.png

zraptor
Frequent Visitor

@AH , my apologies, you are correct!  My math was wrong.  I'm excited to see the correct math in your column!  The hard part is can you display that percentage in a card sepretely of the table?

 

I just did this and I get a count of the locations out of range but ONLY if dropped into the table, I get nothing (blank) when used in a card....    

 

countrows(FILTER('Location_Times',[VAR Time]>15))
Ahmedx
Super User
Super User

I understand why YOU have 62% because you incorrectly calculated the difference in this place:
Los Angeles 21:30 21:33 63
you should have 3 minutes and not 63, that's where you have 62%

Ahmedx
Super User
Super User

Are you sure of your calculation? I got such a percentage
explain how you received 62% on the date 3/14/2023?
Screen Capture #664.png

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.