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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
ashish18
New Member

Calendar Date not working with created date and resolved date

Hi Guys,

 I am trying to get total open defect Vs closed defect per day from Source file. Source file has created on date and Resolve date. I want these both dates to behave with calender date.

I have created date table using below code and also created measures for total open defects and closed defect.

I have set relationship of datetable date with created on date on file

another relationship is inactive with resolved date as its not possible.

Now,I am getting open defects correctly but closed defects not working with date.

 

DateTable =
ADDCOLUMNS (
    CALENDAR (MIN('SourceFile'[Created on Date]), MAX('SourceFile'[Resolved])),
    "Year", YEAR([Date]),
    "Month", FORMAT([Date], "MMMM"),
    "MonthNumber", MONTH([Date]),
    "Weekday", FORMAT([Date], "dddd")
)
Total Closed Defects =
CALCULATE (
    COUNTROWS ('SourceFile'),
    USERELATIONSHIP (DateTable[Date], 'SourceFile'[Resolved])
)  
 
 
Total Open Defects =
CALCULATE (
    COUNTROWS ('SourceFile'),
    FILTER (
        'SourceFile',
        'SourceFile'[Created on Date] <= MAX(DateTable[Date]) &&
        (ISBLANK('SourceFile'[Resolved]) || 'SourceFile'[Resolved] > MAX(DateTable[Date]))
    )
)
ashish18_0-1761920818750.png

Can you please help me to get closed defects to reflect by day. Thanks in advance.

2 ACCEPTED SOLUTIONS

@ashish18 ,

hey, I recreated the measures and everything you had, and I have no issues; it must be the DateTime in the Resolved Date, perhaps.

 

The 9 likely represents the 9 missing Resolved Dates in the source I had.

vojtechsima_0-1761926700834.png

 

Check out my file and compare it with yours.






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

View solution in original post

@ashish18 , thought so, good you found it. If you could please mark my answer as the solution to close the thread. Thanks






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

View solution in original post

7 REPLIES 7
vojtechsima
Super User
Super User

@ashish18 hey, double check that all dates you use to build a calendar and the calendar itself it set to Date not Datetime.






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

HI @vojtechsima  Thnaks for ur response.. Even if I change it to datetime,it still give same issue

@ashish18 , Change it do DATE, not datetime. Otherwise, all seems good. If you have sample pbix file , you can share it through OneDrive/Google Drive.






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

HI @vojtechsima   Sorry if I missed anything. DateTable already has Date

 
DateTable =
ADDCOLUMNS (
    CALENDAR (MIN('SourceFile'[Created on Date]), MAX('SourceFile'[Resolved])),
    "Year"YEAR([Date]),
    "Month"FORMAT([Date]"MMMM"),
    "MonthNumber"MONTH([Date]),
    "Weekday"FORMAT([Date]"dddd")
)

@ashish18 ,

hey, I recreated the measures and everything you had, and I have no issues; it must be the DateTime in the Resolved Date, perhaps.

 

The 9 likely represents the 9 missing Resolved Dates in the source I had.

vojtechsima_0-1761926700834.png

 

Check out my file and compare it with yours.






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

Hi @vojtechsima Really appreciate ur help. It was a minor mistake...Resolved date in sourcr file was dateTime type.I changed it to Date and it worked now. 🙂  Thanks Again!!

@ashish18 , thought so, good you found it. If you could please mark my answer as the solution to close the thread. Thanks






Any kudos or recognition appreciated. To learn more on the topic, check out my blog and follow me on LinkedIn.

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.