Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Solved! Go to Solution.
Hi @Anonymous
AND() only takes two arguments. If you want to use more then you need to use &&
Measure 2 = VAR __CurrentMeasure =
CALCULATE (
COUNT ( 'Before'[Start (Date)]),
FILTER ('Before 2021',
( YEAR(DATEVALUE('Before'[Start(Date)])) <> 2021 && MONTH(DATEVALUE('Before'[Start(Date)])) <> 1 && 'Before'[Start (Date)] <> BLANK())
)
)
RETURN
IF ( ISBLANK ( __CurrentMeasure ), 0, __CurrentMeasure )
Regards
Phil
Proud to be a Super User!
Hi @Anonymous
AND() only takes two arguments. If you want to use more then you need to use &&
Measure 2 = VAR __CurrentMeasure =
CALCULATE (
COUNT ( 'Before'[Start (Date)]),
FILTER ('Before 2021',
( YEAR(DATEVALUE('Before'[Start(Date)])) <> 2021 && MONTH(DATEVALUE('Before'[Start(Date)])) <> 1 && 'Before'[Start (Date)] <> BLANK())
)
)
RETURN
IF ( ISBLANK ( __CurrentMeasure ), 0, __CurrentMeasure )
Regards
Phil
Proud to be a Super User!
You can either nest multiple ANDs together or (easier) just use && between each term instead of AND. Also, you should avoid filtering the whole table. It is better practice to use this approach
FILTER(ALL('Before'[Start(date)]), ... && ... &&... )
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |