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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
bo_wang5
Helper II
Helper II

calculation using if statements not showing totals for the column

All,

 

I need some help getting the total sum to show. when i'm using if statements.

 

Reference #DataType
x-11000Forecast
x-22000Forecast
x-45000Forecast
x-11000Result
x-22000Result
x-33000Result

 

This is sample data in the raw form.  I used a series of mesures to turn the data into the following in a matrix visual in powerBI.  everything on this visual with the exeption of the Reference # are measures.

 

Reference #ForecastResultForecast StatusStatusIn forecast closednot in forecast and closedin forecast not closed
x-110001000in forecastclosed1000

0

0
x-220002000in forecastclosed200000
x-3 3000not in forecastclosed030000
x-45000 in forecastno closed005000
        
Total80006000  no totalno totalno total

 

when i"m writing my measure for "In forecast closed" for example: I have the following code:

 

In forecast closed=if([Forecast Status]="in forecast",if([Status]="closed",[Result],0),if(HASONEVALUE(Data[Reference #]),0,"no total")

 

I wrote the word "no total" where I didn't know how to make it sum the entire column, much appriciated if anyone give me some idea how to sum this.

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

In forecast closed=SUMX(VALUES(Data[Reference #]),if([Forecast Status]="in forecast"&&[Status]="closed",[Result],0))

View solution in original post

1 REPLY 1
wdx223_Daniel
Super User
Super User

In forecast closed=SUMX(VALUES(Data[Reference #]),if([Forecast Status]="in forecast"&&[Status]="closed",[Result],0))

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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