Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
dheerendram
Regular Visitor

DAX FUNCTION HELP- Calculating SLA

Hi All, 

 

I need help with calculating SLA% for below listed data using a dax function 

Sample Data:

Total Closed Ticket = 100

Closed 2 Days = 70
5 Days = 20
10 Days= 10

Tips: This is how I'm calculating the SLA in Excelsheet: 

2 Days/ Total Closed = 2 Days% 
2 Days+5 Days/Total Closed = 5 Day% and so on. 

 

Thank you in advance 💯💯

1 ACCEPTED SOLUTION
v-binbinyu-msft
Community Support
Community Support

Hi @dheerendram ,

Please try to create measure with below dax formula:

3 Days =
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Status] = "Closed" )
VAR tmp1 =
    FILTER ( ALL ( 'Table' ), [Ageing] <= "3 Days" )
VAR _a =
    COUNTROWS ( tmp )
VAR _b =
    COUNTROWS ( tmp1 )
VAR _result =
    DIVIDE ( _b, _a )
RETURN
    FORMAT ( _result, "percent" )
4 Days =
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Status] = "Closed" )
VAR tmp1 =
    FILTER ( ALL ( 'Table' ), [Ageing] <= "4 Days" )
VAR _a =
    COUNTROWS ( tmp )
VAR _b =
    COUNTROWS ( tmp1 )
VAR _result =
    DIVIDE ( _b, _a )
RETURN
    FORMAT ( _result, "percent" )

vbinbinyumsft_0-1699323839075.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-binbinyu-msft
Community Support
Community Support

Hi @dheerendram ,

Please try to create measure with below dax formula:

3 Days =
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Status] = "Closed" )
VAR tmp1 =
    FILTER ( ALL ( 'Table' ), [Ageing] <= "3 Days" )
VAR _a =
    COUNTROWS ( tmp )
VAR _b =
    COUNTROWS ( tmp1 )
VAR _result =
    DIVIDE ( _b, _a )
RETURN
    FORMAT ( _result, "percent" )
4 Days =
VAR tmp =
    FILTER ( ALL ( 'Table' ), [Status] = "Closed" )
VAR tmp1 =
    FILTER ( ALL ( 'Table' ), [Ageing] <= "4 Days" )
VAR _a =
    COUNTROWS ( tmp )
VAR _b =
    COUNTROWS ( tmp1 )
VAR _result =
    DIVIDE ( _b, _a )
RETURN
    FORMAT ( _result, "percent" )

vbinbinyumsft_0-1699323839075.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-binbinyu-msft Thank you so much. It worked!!

dheerendram
Regular Visitor

I hope I'm making more sense now. Here;s the sample data. "I calculated the ageing based on "networkingdays" and "swtich" to reflect the numbers as " Days." 

Sample Ticket IDCreated on Closed on StatusAgeing
2411/4/202311/8/2023Closed3 Days
2511/5/202311/9/2023Closed4 Days
2611/6/202311/10/2023Closed5 Days
2711/7/202311/11/2023Closed4 Days
2811/8/202311/12/2023Closed3 Days
2911/9/202311/13/2023Closed3 Days
3011/10/202311/14/2023Closed3 Days
3111/11/202311/15/2023Closed3 Days

 

Thank you for quick response. 

It makes no sense. 🙄
Please put time and effort into writing questions.
Provide example input and outputs with clear consoe de
scripton.
Ask a manager or friend to help you if you dont know how.
Otherwise is wastes your time and ours.
We want to help.

speedramps
Super User
Super User

We want to help you but your description is too vaugue. Please write it again clearly.

Provide example input data as table text (not a screen print) so we can import the data to build a solution for you.
Also provide the example desired output, with a clear description of the process flow.
Remember not to share private data ... we don't want you to get into trouble. 😧
Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you.
Try keep it simple and ask one question per ticket.
You will get a quick response if you put time, care and effort into writing clear problem descriptions.

Vaugue descriptions can waste your time and ourtime.

Look foward to helping you when the above information is forthcoming

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.