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
Anonymous
Not applicable

Power BI DAX

I am trying to calculate a complaince %. The compliance is the count of number under 270. A simple calucation would be:

 

(count of durantion times under 270) / (count of duration times)

 

This is the DAX I am trying to use in a quick masure but its not working. Any suggestions

 

Measure 1 = (CALCULATE(COUNT('2020 Turn Around Times'[Turnaround Time (Minutes)]), '2020 Turn Around Times'[Turnaround Time (Minutes)]<=270))/(COUNT('2020 Turn Around Times'[Turnaround Time (Minutes)]))
 
Thanks!
Robin
1 ACCEPTED SOLUTION

I think I ended up writing the same measure as you did, but it got the expected result.

 

Pct on Time =
CALCULATE (
COUNT ( '2020 Turnaround Times'[Turnaround Time (Minutes)] ),
'2020 Turnaround Times'[Turnaround Time (Minutes)] <= 270
)
/ COUNT ( '2020 Turnaround Times'[Turnaround Time (Minutes)] )

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , for the filter you need a row context, I assumed that as call ID (Replace with the correct column)

Try lik

Measure 1 = (CALCULATE(COUNTX(Filter(Summarize('2020 Turn Around Times','2020 Turn Around Times'[Call ID],"_1",[Turnaround Time (Minutes)]), [_1]<=270),[_1])/(COUNT('2020 Turn Around Times'[Turnaround Time (Minutes)])))

Anonymous
Not applicable

That didn't work.  The correct calculation (I know because I tested it in Excel) is 55.56%. Below is a screen shot of the data I'm working with. I need to know the % of times that the minutes are less than or equal to 270.

 

Thank you for your help

Test Data.PNG

 

Hi @Anonymous 

If the problem is still there, could you share any sample data?

 

Best Regards

Maggie

I think I ended up writing the same measure as you did, but it got the expected result.

 

Pct on Time =
CALCULATE (
COUNT ( '2020 Turnaround Times'[Turnaround Time (Minutes)] ),
'2020 Turnaround Times'[Turnaround Time (Minutes)] <= 270
)
/ COUNT ( '2020 Turnaround Times'[Turnaround Time (Minutes)] )

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.