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

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
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