Forum Discussion
subho220
5 years agoHelper I
DAX issue
Helloss, Can anyone tell me the solution of the below mention Problem ? -> I have a calculated column in my fact table, which is - Test Request Age_New = DATEDIFF('FACT_Lab_Test_Request'[LI...
- 5 years ago
Hi subho220 ,
Modify your measure as below:
Test Request Age_New = DATEDIFF ( MAX('FACT_Lab_Test_Request'[Date]), NOW (), DAY ) - IF ( ISBLANK ( COUNTROWS ( FILTER ( HolidayList, AND ( HolidayList[Date] >= MAX('FACT_Lab_Test_Request'[Date]), HolidayList[Date] <= NOW () ) ) ) ), 0, COUNTROWS ( FILTER ( HolidayList, AND ( HolidayList[Date] >= MAX('FACT_Lab_Test_Request'[Date]), HolidayList[Date] <= NOW () ) ) ) )And you will see:
For the related .pbix file,pls see attached.
v-kelly-msft
5 years agoCommunity Support
Hi subho220 ,
Modify your measure as below:
Test Request Age_New =
DATEDIFF (
MAX('FACT_Lab_Test_Request'[Date]),
NOW (),
DAY
)
- IF (
ISBLANK (
COUNTROWS (
FILTER (
HolidayList,
AND (
HolidayList[Date] >= MAX('FACT_Lab_Test_Request'[Date]),
HolidayList[Date] <= NOW ()
)
)
)
),
0,
COUNTROWS (
FILTER (
HolidayList,
AND (
HolidayList[Date] >= MAX('FACT_Lab_Test_Request'[Date]),
HolidayList[Date] <= NOW ()
)
)
)
)
And you will see:
For the related .pbix file,pls see attached.