Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
AmineGatou
Frequent Visitor

How to calculate Total of a measure including blanks

Hello everybody so I have this problem right here 

AmineGatou_0-1651074341130.png

I want the total of GapVsMedian to include the blank values also 
Expected Value -429 
Got Value of -121 (-63-58)

How can I include those -77 in my measure? 

4 REPLIES 4
Anonymous
Not applicable

Hi @AmineGatou,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

hi @Anonymous , sorry for late reply i was out of office past days
So basically 

AmineGatou_0-1653406494292.png

I want those "-77" who are blanks in "Turnover" to be included in the sum calculations

PWBI file in link => SumProblemPwbi.pbix

johnt75
Super User
Super User

Rename your current measure to Individual Gap vs Median then use

Gap vs Median = IF( ISINSCOPE( 'Table'[Customer name]), [Individual Gap vs Median],
var summaryTable = ADDCOLUMNS( VALUES('Table'[Customer name]), "@val", [Individual Gap vs Median])
return SUMX(summaryTable, [@val])
)

@johnt75  Nop it didn't work, it gave me exactly the same thing 

AmineGatou_0-1651161390337.png

Individual Gap vs Median = IF(HASONEFILTER(Data[Raison sociale]),[TotCA]-[Mediane],SUMX(VALUES(Data[Raison sociale]),[TotCA]-[Mediane]))

GapVSMed = IF(ISINSCOPE( Data[Raison sociale]), [Individual Gap vs Median],
var summaryTable = ADDCOLUMNS( VALUES(Data[Raison sociale]), "@val", [Individual Gap vs Median])
return SUMX(summaryTable, [@val]))

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors