Forum Discussion
Weekly Check Calculation
- 2 years ago
Hi snoozee ,
Based on the screenshot you provided, you need to change the code slightly as follows.
Weekly Check = VAR CurrentLocation = 'Table'[Location] VAR Cnt = CALCULATE ( COUNT ( 'Table'[CheckNotCompleted] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[WeekNumber] ), 'Table'[CheckNotCompleted] = "Yes" && 'Table'[Location] = CurrentLocation ) ) RETURN IF ( Cnt >= 1, "Y", "N" )Result is as below.
Hope that works for you.
For further details,please find attachment.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
WINDOW function (DAX) - DAX | Microsoft Learn
Expected result CC =
VAR _t =
FILTER (
WINDOW (
1,
ABS,
-1,
ABS,
Data,
ORDERBY ( Data[Date], ASC ),
,
PARTITIONBY ( Data[Location], Data[Year], Data[Week Number] ),
MATCHBY ( Data[Location], Data[Date] )
),
Data[CheckNotCompleted] = "Y"
)
RETURN
IF ( COUNTROWS ( _t ) >= 1, "Y", "N" )
- snoozee2 years agoRegular Visitor
Jihwan_Kim Thank you so much for replying so quickly !!
Unfortunately this doesn't work for me as i'm getting an error of - Cannot find name 'Window' , 'Window' is not a function, Parameter is not the correct type.
This is probably related to the version of Power Bi I'm using - May 2021 and unfortunately i can't update it as it's controlled by my work 😞
This is also the reason why i can't open your attachment either.
Is there any other option available ?