Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi Power Bi Community,
i created a measure that counts rows of when a "status" column = 5, and the same thing when the status = 9
I want to subtract the count of s5 from count of s9 so i created another measure called subtract. however sometimes the count of s5 is null and returns to me (0-1= -1). i created another measure with an if statement below:
but the totals are still the same... what i am trying to do is the following:
Sum the count of s5 per employee BUT only subtract "count of s9" when count of s5 is not null. so for alexi's case i would like the true sum of the column "measure" which is actually 1+0+1+1+1+0+1+1=6
Solved! Go to Solution.
Hi @Melmehal , you can try this one:
1. Create a calculated column:
Counts_Col = var x = CALCULATE(COUNT(quotelog[status]), quotelog[status] = "S5", quotelog[quote] = EARLIER(quotelog[quote])) var y = CALCULATE(COUNT(quotelog[status]), quotelog[status] = "S9", quotelog[quote] = EARLIER(quotelog[quote])) return IF(ISBLANK(x),0,x-y)
Total-S5&S9 = SUM(quotelog[Counts_Col])
Hi @Melmehal , you can try this one:
1. Create a calculated column:
Counts_Col = var x = CALCULATE(COUNT(quotelog[status]), quotelog[status] = "S5", quotelog[quote] = EARLIER(quotelog[quote])) var y = CALCULATE(COUNT(quotelog[status]), quotelog[status] = "S9", quotelog[quote] = EARLIER(quotelog[quote])) return IF(ISBLANK(x),0,x-y)
Total-S5&S9 = SUM(quotelog[Counts_Col])
Could you please clarify more details and show the sample data and expected result?
Regards,
Jimmy Tao
Hi Jimmy,
I just need the column called measure to sum up to 6 instead of 5
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.