Forum Discussion
HabibAdil
5 years agoHelper IV
Counting Active Rows in a Time Period
Hi everyone, Please can someone help me with the following. I tried to use the approach expalined in this link (https://powerpivotpro.com/2013/04/counting-active-rows-in-a-time-period-guest-post-fro...
- 5 years ago
Hi HabibAdil ,
Just try this:
NCR Active_YN = VAR StatDate = MINX ( ALLSELECTED ( 'Calendar' ), 'Calendar'[Date] ) VAR EndDate = MAXX ( ALLSELECTED ( 'Calendar' ), 'Calendar'[Date] ) RETURN IF ( SELECTEDVALUE ( OE_BD_NCR_Reports[NCR_Date_Raised] ) IN VALUES ( 'Calendar'[Date] ), SWITCH ( TRUE (), ISBLANK ( SELECTEDVALUE ( OE_BD_NCR_Reports[NCR_Date_Closed] ) ), "Y", SELECTEDVALUE ( OE_BD_NCR_Reports[NCR_Date_Closed] ) > EndDate, "Y", "N" ) )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Icey
5 years agoCommunity Support
Hi HabibAdil ,
Just try this:
NCR Active_YN =
VAR StatDate =
MINX ( ALLSELECTED ( 'Calendar' ), 'Calendar'[Date] )
VAR EndDate =
MAXX ( ALLSELECTED ( 'Calendar' ), 'Calendar'[Date] )
RETURN
IF (
SELECTEDVALUE ( OE_BD_NCR_Reports[NCR_Date_Raised] )
IN VALUES ( 'Calendar'[Date] ),
SWITCH (
TRUE (),
ISBLANK ( SELECTEDVALUE ( OE_BD_NCR_Reports[NCR_Date_Closed] ) ), "Y",
SELECTEDVALUE ( OE_BD_NCR_Reports[NCR_Date_Closed] ) > EndDate, "Y",
"N"
)
)
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.