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.
Hi everybody.
I have to build a matrix which shows count frequencies over 3 variables that form a hierarchy (building-machine-sensor) on a matrix.
We need to show 0 when the combination of the 3 variables has no rows in the table of interest, but we also keep getting an empty row when we use the countrows function.
The matrix is the one on the left (with a card showing "4" on top).
You can see the dax function on the function toolbar on top.
Contatore Anomalie Import = COUNTROWS ( DISTINCT('Fact Anomalies Import'[VarKey]))+0
I added the "+0" at the end to show the combinations with null frequencies, but we're also getting the empty row at the top and we can't seem to get rid of it, I also tried using VALUES function instead of DISTINCT but it was of no use.
How can we get rid of the empty row but keep the null ones?x
Please help us!
Hi @Anonymous ,
Try
Contatore Anomalie Import =
VAR _a =
COUNTROWS ( DISTINCT ( 'Fact Anomalies Import'[VarKey] ) )
RETURN
IF ( ISBLANK ( _a ), 0, _a )
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
89 | |
49 | |
44 | |
38 | |
37 |