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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

count taking into account date conditions

Hi all,

Here is my problem:

I would like to calculate de YTD number of incidentes solved in time or out of date, following the conditions explained bellow:

 

Table:

[Incident]

[Date of entry]

[Date of resolution]

[Expiration Date]

 

If [Data of resolution] = null -> then -> IF[expiration Date] > the date in the filter context (for example FY 2010 and April seleted in the slicer) -> Then "In Time", else "Out of Date"

But

If [Data of resolution] = is not null -> then IF[expiration Date]> [Data of resolution] -> Then "In Time", else "Out of Date"

Attached you can find the link to the pbx file 

Thank you so much for your help

Rbn

 

 

1 ACCEPTED SOLUTION

Well, if you need this to be interactive based on a slicer, then you cannot code a column in Power Query or as a DAX calculated column, because columns are calculated at the time of data load and are thus not dynamic based upon user interaction.

 

What you need is a measure and if you need to comparie "previous" rows, you will need to use something like EARLIER. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

Sorry, not entirely clear on this. But perhaps a variation of Open Tickets? https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364#M147



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks @Greg_Deckler for the tip

 

Sorry if I have not been clear, english is not my first language, and sometimes is not easy to put in words in a clear way  all my thoughs.

 

Basically what I want to do is a custom column with "met" or "missed" values, based on if the "expiration date" is greater than the "date of resolution". The problem is when the "date of resolution" is null. In this case I want to compare with the date last date ot the month filtered with the slicer. For example, in the second line that I have an error, and asumming that in the slicer I have selected March 2020, I would likte to compare  31/03/2020 with 15/05/2020 and return a "Met" value.

In the line 4 on the contrary I would compare 31/03/2020 with 15/03/2020 and return "Missed"

 

 

 

Captura.PNG

 

Thank you very much

Well, if you need this to be interactive based on a slicer, then you cannot code a column in Power Query or as a DAX calculated column, because columns are calculated at the time of data load and are thus not dynamic based upon user interaction.

 

What you need is a measure and if you need to comparie "previous" rows, you will need to use something like EARLIER. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors