The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello powerbi community,
I'm trying to display a 0 value instead of blank, when record count from a related table does not give any values.
Ex. Table 1 (Parent) has no related records in Table 2 (Child), so count is blank. But, id like to show 0's in a matrix table or visual.
Ex. Adults (Table 1) who dont have kids (Table 2)
I tried creating a measure in Table 1 that says, but It didnt give me a proper result:
IF ( ISBLANK (CALCULATE ( COUNTROWS(RELATEDTABLE(Table2)))), 0 , CALCULATE ( COUNTROWS(RELATEDTABLE(Table2))
Any suggestions on what to do here?
Thank you
Solved! Go to Solution.
The original formula worked with a column instead of a measure. Still learning the difference...
The original formula worked with a column instead of a measure. Still learning the difference...
@VijayP thank you. I tried putting a +0, but it did not work.
I tried:
IF ( ISBLANK (CALCULATE ( COUNTROWS(RELATEDTABLE(Table2)))), 0 , CALCULATE ( COUNTROWS(RELATEDTABLE(Table2)) +0
How can one show that ID #1 from Table 1 has 0 (NOT BLANK!) records from child Table 2. There must be a way.
I've been turning around in circles.
Thanks,
After entire formula just add +0 , you will get required result
Proud to be a Super User!
many thanks
User | Count |
---|---|
77 | |
75 | |
36 | |
31 | |
29 |
User | Count |
---|---|
93 | |
81 | |
57 | |
48 | |
48 |