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
Milozebre
Helper V
Helper V

Condition in a measure

Hello,
I have a question because I block to make an indicator.
I have to calculate a service level indicator.
Here is what I would like to do: add all calls processed whose waiting time is less than or equal to 120 divided by the total number of calls processed
My queries are under SQL and I have data:
Call processed - WaitingTime

Can you help me make this request or this measure because I can't insert this condition.

 

thank you in advance

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

Okay try this instead

Mesure 2 =
DIVIDE (
    CALCULATE (
        SUM ( 'ACD - APPEL'[AppelTraite] ),
        FILTER ( ALLSELECTED ( 'ACD - APPEL' ), 'ACD - APPEL'[DureeAttente] <= 120 )
    ),
    CALCULATE ( SUM ( 'ACD - APPEL'[AppelTraite] ), ALLSELECTED ( 'ACD - APPEL' ) ),
    0
)

View solution in original post

7 REPLIES 7
Phil_Seamark
Employee
Employee

Hi @Milozebre,

 

This sounds achievable, but for us to build a measure as close as possible to your needs, can you please post a sample set of data.

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Good Morning Phil, 

 

Thank you for your reply.

 

Here is the begining of the measure : Mesure 2 = SUM('ACD - APPEL'[AppelTraite]) / SUM('ACD - APPEL'[AppelTraite])

But i want to do : sum of all appel traite where ('ACD - APPEL'[DureeAttente]) is <= 120 divided by the total of ACD - APPEL'[AppelTraite])

 

 

Sean
Community Champion
Community Champion

Here's something to get you going... Smiley Happy

 

Mesure 2 =
DIVIDE (
    CALCULATE (
        SUM ( 'ACD - APPEL'[AppelTraite] ),
        FILTER ( ALL ( 'ACD - APPEL' ), 'ACD - APPEL'[DureeAttente] <= 120 )
    ),
    CALCULATE ( SUM ( 'ACD - APPEL'[AppelTraite] ), ALL ( 'ACD - APPEL' ) ),
    0
)

 

Here its  10:27 am 🙂

 

thank you Sean for your help but  when I try your measure, i get a number 93% and when I put time filter on the visual element : it stay a 93% 

I try several dates and same result 😞

 

 

Sean
Community Champion
Community Champion

Okay try this instead

Mesure 2 =
DIVIDE (
    CALCULATE (
        SUM ( 'ACD - APPEL'[AppelTraite] ),
        FILTER ( ALLSELECTED ( 'ACD - APPEL' ), 'ACD - APPEL'[DureeAttente] <= 120 )
    ),
    CALCULATE ( SUM ( 'ACD - APPEL'[AppelTraite] ), ALLSELECTED ( 'ACD - APPEL' ) ),
    0
)
Sean
Community Champion
Community Champion

Hey @Milozebre  I'm not sure about your Text requirement - but yes basically put the "TEXT" value in quotes

 

Take a look here

http://www.sqlbi.com/articles/filter-arguments-in-calculate/

Good evening here 11:23 pm 16/03 🙂

 

I'm sorry for the late reply. Many thanks to you for your help. It works. In view of the answer, I would never have found it. 🙂

 

Thank you from Belgium.

 

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.