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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Pavani
Helper I
Helper I

How to create a dax Created MTD , Last 7 Days and Last 24 hours

Hi ,

 

Please help to create a DAX as per below request .

 

Incident Data P1 & P2 tickets Table: ( MTD Status)

Created Tickets: Created data account, ticket type incident, Priority High and critical (P1 & P2), MTD data for Submit Date. 

Closed Tickets : Closed data account, ticket type incident, Priority High and critical (P1 & P2), MTD data for Resolved / Completed Date.

  In Progress Tickets : Open data account, ticket type incident, Priority High and critical (P1 & P2).

0-7 Days = Open data account, ticket type incident, Priority High and critical (P1 & P2), Aging Days less than 8 days.

Is >7 Days = Open data account, ticket type incident, Priority High and critical (P1 & P2), Aging Days Greater than 8 days less than 16 Days.

Is  > 15 Days = Open data account, ticket type incident, Priority High and critical (P1 & P2), Aging Days Greater than 16 days less than 31 Days.

Is >31 Days = Open data account, ticket type incident, Priority High and critical (P1 & P2), Aging Days Greater than 31 days.

 

Regards,

Pavani. K

2 ACCEPTED SOLUTIONS

Hello @Pavani , 

 

You have to create 7 measures for like the below...

 

1. For Created Tickets below similarly create for Cosed and Inprogreess by changing the filter.

 

CreatedTickets =
CALCULATE(
COUNTROWS('Incident Data'),
'Incident Data'[Ticket Type] = "Incident",
'Incident Data'[Priority] IN {"P1", "P2"},
MONTH('Incident Data'[Submit Date]) = MONTH(TODAY()))

 

2. For Aging Tickets you need to apply various filter and create logic I have creacted for couple fo them please try to creat for other with simi;ar logics by changing the Days bucket accordingly

 

Open0to7Days =
CALCULATE(
COUNTROWS('Incident Data'),
'Incident Data'[Ticket Type] = "Incident",
'Incident Data'[Priority] IN {"P1", "P2"},
DATEDIFF('Incident Data'[Submit Date], TODAY(), DAY) <= 7,
ISBLANK('Incident Data'[Resolved Date]))

 

OpenGreaterThan31Days =
CALCULATE(
COUNTROWS('Incident Data'),
'Incident Data'[Ticket Type] = "Incident",
'Incident Data'[Priority] IN {"P1", "P2"},
DATEDIFF('Incident Data'[Submit Date], TODAY(), DAY) > 31,
ISBLANK('Incident Data'[Resolved Date]))

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

View solution in original post

v-kongfanf-msft
Community Support
Community Support

Hi @Pavani ,

 

Maybe you can try formula like below to create measure:

Aging0to7Days = 
CALCULATE(
    COUNTROWS('Incident Data'),
    'Incident Data'[Ticket Type] = "incident",
    'Incident Data'[Priority] IN {"High", "Critical"},
    'Incident Data'[Aging Days] < 8
)
Aging8to15Days = 
CALCULATE(
    COUNTROWS('Incident Data'),
    'Incident Data'[Ticket Type] = "incident",
    'Incident Data'[Priority] IN {"High", "Critical"},
    'Incident Data'[Aging Days] >= 8,
    'Incident Data'[Aging Days] <= 15
)
Aging16to31Days = 
CALCULATE(
    COUNTROWS('Incident Data'),
    'Incident Data'[Ticket Type] = "incident",
    'Incident Data'[Priority] IN {"High", "Critical"},
    'Incident Data'[Aging Days] > 15,
    'Incident Data'[Aging Days] <= 31
)

vkongfanfmsft_0-1727683040473.png

Best Regards,
Adamk Kong

 

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

4 REPLIES 4
v-kongfanf-msft
Community Support
Community Support

Hi @Pavani ,

 

Maybe you can try formula like below to create measure:

Aging0to7Days = 
CALCULATE(
    COUNTROWS('Incident Data'),
    'Incident Data'[Ticket Type] = "incident",
    'Incident Data'[Priority] IN {"High", "Critical"},
    'Incident Data'[Aging Days] < 8
)
Aging8to15Days = 
CALCULATE(
    COUNTROWS('Incident Data'),
    'Incident Data'[Ticket Type] = "incident",
    'Incident Data'[Priority] IN {"High", "Critical"},
    'Incident Data'[Aging Days] >= 8,
    'Incident Data'[Aging Days] <= 15
)
Aging16to31Days = 
CALCULATE(
    COUNTROWS('Incident Data'),
    'Incident Data'[Ticket Type] = "incident",
    'Incident Data'[Priority] IN {"High", "Critical"},
    'Incident Data'[Aging Days] > 15,
    'Incident Data'[Aging Days] <= 31
)

vkongfanfmsft_0-1727683040473.png

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

SachinNandanwar
Solution Specialist
Solution Specialist

I guess it would require to create 7 measures.



Regards,
Sachin
Check out my Blog
Disclaimer : My solutions are my own and are not AI generated

Yes, How I need to create DAX for this requirements , please help on to resolve.

 

Thanks! 

Hello @Pavani , 

 

You have to create 7 measures for like the below...

 

1. For Created Tickets below similarly create for Cosed and Inprogreess by changing the filter.

 

CreatedTickets =
CALCULATE(
COUNTROWS('Incident Data'),
'Incident Data'[Ticket Type] = "Incident",
'Incident Data'[Priority] IN {"P1", "P2"},
MONTH('Incident Data'[Submit Date]) = MONTH(TODAY()))

 

2. For Aging Tickets you need to apply various filter and create logic I have creacted for couple fo them please try to creat for other with simi;ar logics by changing the Days bucket accordingly

 

Open0to7Days =
CALCULATE(
COUNTROWS('Incident Data'),
'Incident Data'[Ticket Type] = "Incident",
'Incident Data'[Priority] IN {"P1", "P2"},
DATEDIFF('Incident Data'[Submit Date], TODAY(), DAY) <= 7,
ISBLANK('Incident Data'[Resolved Date]))

 

OpenGreaterThan31Days =
CALCULATE(
COUNTROWS('Incident Data'),
'Incident Data'[Ticket Type] = "Incident",
'Incident Data'[Priority] IN {"P1", "P2"},
DATEDIFF('Incident Data'[Submit Date], TODAY(), DAY) > 31,
ISBLANK('Incident Data'[Resolved Date]))

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.