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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Rapports
Helper I
Helper I

Calculate statement with IF

Hello, 

please i have do this mesure (Total_Absence/Seance = CALCULATE([Total_Seance_Planifiee],rpt_adAttendanceDetail_vw[P/A]="A") ) it works but the problem is when we dont have a "A" and we have a "P"  it give a blank, I need it to give me a 0 instead of blank how  can i fixe it ??? 

1 ACCEPTED SOLUTION
AndrewPF
Helper V
Helper V

This may work:
Total_Absence/Seance = if(isblank(CALCULATE([Total_Seance_Planifiee],rpt_adAttendanceDetail_vw[P/A]="A")),0,CALCULATE([Total_Seance_Planifiee],rpt_adAttendanceDetail_vw[P/A]="A"))
or: 

if(rpt_adAttendanceDetail_vw[P/A]="P",0,CALCULATE([Total_Seance_Planifiee]))

Without seeing your data, I cannot decide which would work better. 

View solution in original post

1 REPLY 1
AndrewPF
Helper V
Helper V

This may work:
Total_Absence/Seance = if(isblank(CALCULATE([Total_Seance_Planifiee],rpt_adAttendanceDetail_vw[P/A]="A")),0,CALCULATE([Total_Seance_Planifiee],rpt_adAttendanceDetail_vw[P/A]="A"))
or: 

if(rpt_adAttendanceDetail_vw[P/A]="P",0,CALCULATE([Total_Seance_Planifiee]))

Without seeing your data, I cannot decide which would work better. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors