I'm trying to create a card visual in Power BI that displays a statement of either "Table visual is empty" or "Table visual is not empty". In most cases I could write a measure of COUNT(SUMMARIZE([Table],[Col1],[Col2]))
to evaluate the number of records and return a result.
However, this visual both contains columns from more than one source table. To my knowledge using COUNT(SUMMARIZE())
does not accommodate more than one table. Likewise, if my table is filtered to 0 rows by a slicer the measure would not respond to the change and would display an incorrect result.
My current measure is:
EmptyTable = IF(COUNT(SUMMARIZE([Table1],[Col1],[Col2]...,[Col9])) = 0
, "Table has no rows", "Table contains rows")
But as I said, this SUMMARIZE statement only accounts for one table, whereas the visual contains fields from two other tables.
Is there a way to count the rows in a table visual while accommodating how it's affected by slicers?
Example dataset: Base State
[Slicer] [Table Visual]
ID 1 [✓] ID Value
ID 2 [✓] 1 10
ID 3 [✓] 2 20
ID 4 [✓] 4 40
[Dax Measure]: "Table Visual Is Not Empty"
Example dataset: Preferred End State
[Slicer] [Table Visual]
ID 1 [ ] ID Value
ID 2 [ ]
ID 3 [✓]
ID 4 [ ]
[Dax Measure]: "Table Visual Is Empty"
Base State:
Current State:
Table2 Measure should display "Table2 Visual is empty"
Data Model:
The Dax formula I'm using is :
Table2.Measure = IF(COUNT(Table1[Value])=0
, "Table2 visual is empty", "Table2 visual is not empty")