Forum Discussion
Beginner level - SUMX - FILTER - SELECTEDVALUE
- 5 years ago
Hi StefRenneboog91 ,
I found that your [BEGDA] and [ENDDA] column is a whole number type instead of a date type so I would suggest you to change these data type of columns to date firstly.
Then, based on your description, you can create this measure to count:
Count = VAR _count = CALCULATE ( COUNT ( 'Table'[PERNR] ), FILTER ( ALL ( 'Table' ), 'Table'[STAT2] = 3 && 'Table'[BEGDA] <= SELECTEDVALUE ( 'Date'[Date], TODAY () ) && 'Table'[ENDDA] >= SELECTEDVALUE ( 'Date'[Date], TODAY () ) ) ) RETURN IF ( ISBLANK ( _count ), 0, _count )Attached a sample file in the below, hopes to help you.
Beginner level - SUMX - FILTER - SELECTEDVALUE.pbix
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi StefRenneboog91 ,
I found that your [BEGDA] and [ENDDA] column is a whole number type instead of a date type so I would suggest you to change these data type of columns to date firstly.
Then, based on your description, you can create this measure to count:
Count =
VAR _count =
CALCULATE (
COUNT ( 'Table'[PERNR] ),
FILTER (
ALL ( 'Table' ),
'Table'[STAT2] = 3
&& 'Table'[BEGDA] <= SELECTEDVALUE ( 'Date'[Date], TODAY () )
&& 'Table'[ENDDA] >= SELECTEDVALUE ( 'Date'[Date], TODAY () )
)
)
RETURN
IF ( ISBLANK ( _count ), 0, _count )
Attached a sample file in the below, hopes to help you.
Beginner level - SUMX - FILTER - SELECTEDVALUE.pbix
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.