Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Solved! Go to Solution.
@Anonymous
Please try this
Compliance =
VAR Comp =
CALCULATE (
COUNTROWS ( Append1 ),
Append1[Compliant] = "Compliant",
FILTER ( Append1, Append1[Site] = "X" )
)
VAR Closed =
CALCULATE (
COUNTROWS ( Append1 ),
Append1[Status] = "Closed",
FILTER ( Append1, Append1[Site] = "X" )
)
RETURN
IF ( Comp = BLANK () || Closed = BLANK (), 0, DIVIDE ( Comp, Closed ) )
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thank you @Fowmy ,
When I try that though, it still returns 100%, even if both numerator and denominator are 0 or blank.
Please share a screenshot of the DAX measure and the visual
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Anonymous
What do you expect if both return ZERO?
Can you share a sample PBIX file?
Instead of Filter(Append1,Append1[Site]="X"), try Append1[Site]="X"
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
I tried to use Append1[Site]="X" as suggested and it returned an error to the visual.
Ideally if both return 0- I need it to say 0% instead of 100%- trying to figure out how to share a file without giving out data that is unshareable. Not sure I can.
Basically if 90 are Compliant and 100 are Closed, then the return is 90%. Currently if Compliant is BLANK and Closed are BLANK it is still returning 100% rather than a null or 0.
@Anonymous
Please try this
Compliance =
VAR Comp =
CALCULATE (
COUNTROWS ( Append1 ),
Append1[Compliant] = "Compliant",
FILTER ( Append1, Append1[Site] = "X" )
)
VAR Closed =
CALCULATE (
COUNTROWS ( Append1 ),
Append1[Status] = "Closed",
FILTER ( Append1, Append1[Site] = "X" )
)
RETURN
IF ( Comp = BLANK () || Closed = BLANK (), 0, DIVIDE ( Comp, Closed ) )
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
I just saw this, and was going to suggest the variables. Great job helping solve this. Variables are always a great way to see what the values are against what you think they are.
@Anonymous
You can use the 3rd argument of DIVIDE as zero
Compliance =
CALCULATE (
DIVIDE (
CALCULATE ( COUNTROWS ( Append1 ), Append1[Compliant] = "Compliant" ),
CALCULATE ( COUNTROWS ( Append1 ), Append1[Status] = "Closed" ),
0
),
Append1[Site] = "X"
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group