Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have the following measure which works perfrectly when rows are reutned from both tables but when one table returns no rows there is no response not even "Blank".
I would like to in the event that one of the tables returns no rows display "0".
Dax meaure
Test = Calculate(
Countrows(tablea),
Filter(relatedtable(tableb), and ([Status] = "In Stock", [substatus] = "Available")), tablea[object_type] = 12)
Tableb is not returning any rows as there is no match for [Status] = "In Stock", [substatus] = "Available"
Thanks
Solved! Go to Solution.
VAR FilteredTableB = FILTER( RELATEDTABLE(tableb), [Status] = "In Stock" && [substatus] = "Available" ) RETURN IF( COUNTROWS(FilteredTableB) > 0, CALCULATE( COUNTROWS(tablea), FilteredTableB, tablea[object_type] = 12 ), 0 )
VAR FilteredTableB = FILTER( RELATEDTABLE(tableb), [Status] = "In Stock" && [substatus] = "Available" ) RETURN IF( COUNTROWS(FilteredTableB) > 0, CALCULATE( COUNTROWS(tablea), FilteredTableB, tablea[object_type] = 12 ), 0 )
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |