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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors