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

Sum of Data as it was at a certain date

I need to report on 'Open Faults' and the number of days they've been open at the end of each month. 

 

e.g.

 

DateCreatedFault IDFault StatusAugust 2021July 2021June 2021May 2021April 2021March 2021
05/08/2020 00:001Open390359328298267237
24/11/2020 00:002Open356325294264233203
Total  746684622562500440

 

(The month columns are how long the faults have been  open on the final day of the month)

 

Does anyone know of a DAX expression that can be used to replicate the outcome of this table, rather than me having to create a translation layer/table to do the calculation for me?

 

I'd like to be able to display it along a time axis (DateCreated) but it seems impossible!

3 REPLIES 3
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

Try the measure below. It relies on a disconnected calendar table to populate the column headers and create the measure:

_daysOpen = 
VAR __dateToCheck = MAX(calendar[date])
VAR __dateCreated = MAX(yourTable[dateCreated])
RETURN
COUNTROWS(
    FILTER(
        ALLEXCEPT(calendar, calendar[monthYear]), //calendar[monthYear] = column header field used
        calendar[date] > __dateCreated
        && calendar[date] <= __dateToCheck
    )
)

 

This gives me the following output in a matrix visual:

BA_Pete_0-1631173876919.png

 

You can tweak the '>' and '<=' operators within the FILTER function to fit with your exact reporting needs.

You may also want to wrap the whole RETURN section in an IF statement to only evaluate when [faultStatus] = "Open", but I'll leave that to your taste.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




v-chenwuz-msft
Community Support
Community Support

Hi Nialloe19,

 

Can you give some examples? Or what kind of table or graph you want, please give some example data, thanks.

 

Best Regards

Community Support Team _ chenwu zhu

 

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

Greg_Deckler
Community Champion
Community Champion

@Anonymous Not sure, but I'm thinking you might want: 
Take a look at these two Quick Measures as I think you want something like them.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364
https://community.powerbi.com/t5/Quick-Measures-Gallery/Periodic-Billing/m-p/409365



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