Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (11.1k points)

I am calculating a measure between two dates by using the formula

TAT = CALCULATE(SUM('Days Table'[Is Work Day]),
DATESBETWEEN('Days Table'[Date],'Re-run Data'[DATE_ORDERED],'Re-run 
Data'[DATE_COMPLETED]))

I am not getting a proper result,Is there any way to solve this? 

1 Answer

0 votes
by (22.5k points)

Use the following measures

TAT = 
    COUNTROWS ( 
        FILTER ( 
            ADDCOLUMNS(
                DATESBETWEEN ( 
                    'Calendar'[Date],
                    MIN ( 'Re-run Data'[DATE_ORDERED] ),
                    MAX ( 'Re-run Data'[DATE_COMPLETED] )
                ),
                "Is Weekday", WEEKDAY ( 'Calendar'[Date], 2) < 6,
                "Is Holiday", CONTAINS ( Holidays, Holidays[Holiday Dates], 'Calendar'[Date] )
            ),
            [Is Weekday] = TRUE() && [Is Holiday] = FALSE()
        )
    )

 Want to learn more about Power BI? Register now: Power Bi Course 

Related questions

0 votes
1 answer
0 votes
1 answer
asked Feb 28, 2021 in BI by Chris (11.1k points)
0 votes
1 answer
asked Jan 14, 2021 in BI by Chris (11.1k points)
0 votes
1 answer

Browse Categories

...