Forum Discussion
DAX count blank rows based on conditions
- Anonymous2 years ago
Hi vivians ,
Please try this measure:N_complaint = VAR __count1 = CALCULATE(COUNTROWS('tbl_Report'),'tbl_Report'[Return Status]="Non-return", ALLEXCEPT('tbl_Report',dim_Quarter[Quarter])) VAR __count2 = CALCULATE(COUNT(tbl_Report[Return Status]),'tbl_Report'[Return Status] IN {"Return", "Nil return"},ALLEXCEPT('tbl_Report',dim_Quarter[Quarter])) VAR __result = IF(ISBLANK(__count1) && NOT ISBLANK(__count2),CALCULATE(COUNT(tbl_Report[Return Status]),'tbl_Report'[Return Status]="Return") + 0) RETURN __resultBest Regards,
Gao
Community Support TeamIf 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
Hi vivians ,
Please try this measure:
N_complaint =
VAR __count1 = CALCULATE(COUNTROWS('tbl_Report'),'tbl_Report'[Return Status]="Non-return", ALLEXCEPT('tbl_Report',dim_Quarter[Quarter]))
VAR __count2 = CALCULATE(COUNT(tbl_Report[Return Status]),'tbl_Report'[Return Status] IN {"Return", "Nil return"},ALLEXCEPT('tbl_Report',dim_Quarter[Quarter]))
VAR __result = IF(ISBLANK(__count1) && NOT ISBLANK(__count2),CALCULATE(COUNT(tbl_Report[Return Status]),'tbl_Report'[Return Status]="Return") + 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