Forum Discussion
COALESCE inside CALCULATE ignores FILTER
Hi murkysalt46 ,
Try a branching structure with 2023 returning blank and the rest returning COALESCE(COUNTROWS( Table_A ), 0):
VAR __cur_year = SELECTEDVALUE('Table_A'[Year])
VAR __row_count = COUNTROWS('Table_A')
VAR __result = IF(__cur_year <> "2023", COALESCE(__row_count,0))
RETURN
__result
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Thanks for taking the time to answer Gao. This works!....sometimes. As soon as a slicer is placed on TableA the 0's are filled in for "2023". I'll show with two snippets:
Without interaction of the slicer (blanks for col's with no data):
With interaction (0's for columns with no data):
Added a RAND() factor to obscure the data somewhat.