cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bo_wang5
Helper II
Helper II

Using IF statement to create categories by exclude total

All 

 

I'm trying to sum "Won Q3" by "Forecast Status" and "Status"  here are my measures and I'm not getting the correct totals.
 
Sum Won Q3 = CALCULATE(sum(Data[ASO: Amount (converted)]),filter(Data,Data[Data Entry or Type]="Won-Q3"))
 
Sum 6+6 = CALCULATE(sum(Data[ASO: Amount (converted)]),filter(data,Data[Data Entry or Type]="6+6"))
Sum 7+5
Sum 8+4 are written similar to Sum 6+6
 
Forecast Status = If([Sum 6+6]=0,if([Sum 7+5]=0,if([Sum 8+4]=0,"not in forecast","in forecast"),"in forecast"),"in forecast")
 
Status = if([Sum Won Q3]<=0,"Not Won","won")
 
 In forecast and won = if([Forecast Status]="in forecast",if([Status]="won",[Sum Won Q3],0))
 

bo_wang5_1-1638327950019.png

 

I think this is not working because I show a total in my "Status" and "Forecast Status" columns, but I'm not sure how to filter out that total because it is meaningless since it's a category.

 

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @bo_wang5 

If you want to remove these meaningless totals, you use IF +HASONEVALUE  to replace the total value.

New_Forecast Status = 
IF ( HASONEVALUE ( Data[ASO:Opportunity] ), [Forecast Status], BLANK () )
New Status = 
IF ( HASONEVALUE ( Data[ASO:Opportunity] ), [Status], BLANK () )
New In forecast and won = 
IF (
    HASONEVALUE ( Data[ASO:Opportunity] ),
    [In forecast and won],
    SUMX ( VALUES ( Data[ASO:Opportunity] ), [In forecast and won] )
)

28.png

Best Regards,
Community Support Team _ Eason

View solution in original post

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @bo_wang5 

If you want to remove these meaningless totals, you use IF +HASONEVALUE  to replace the total value.

New_Forecast Status = 
IF ( HASONEVALUE ( Data[ASO:Opportunity] ), [Forecast Status], BLANK () )
New Status = 
IF ( HASONEVALUE ( Data[ASO:Opportunity] ), [Status], BLANK () )
New In forecast and won = 
IF (
    HASONEVALUE ( Data[ASO:Opportunity] ),
    [In forecast and won],
    SUMX ( VALUES ( Data[ASO:Opportunity] ), [In forecast and won] )
)

28.png

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors