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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

filter issue

I have the below measure which works perfectly fine but I want to make a reverse of it.
 
Epic Giveaway Units = calculate(sum('Epic Sales Data'[Net Units]),
filter('Epic Sales Data', if(and(and('Epic Sales Data'[Sale Day] >= date(2020,7,9),'Epic Sales Data'[Sale Day] <= date(2020,7,16)),'Epic Sales Data'[Offer Title]="The Escapists 2"),0,1) = 1),
filter('Epic Sales Data', if(and(and('Epic Sales Data'[Sale Day] >= date(2021,6,17),'Epic Sales Data'[Sale Day] <= date(2021,6,24)),'Epic Sales Data'[Offer Title]="Overcooked! 2"),0,1) = 1)
 
So I create the below measure which swaps around the 0 and 1 in the IF statements TRUE AND FALSE values:
 
Epic Giveaway Units = calculate(sum('Epic Sales Data'[Net Units]),
filter('Epic Sales Data', if(and(and('Epic Sales Data'[Sale Day] >= date(2020,7,9),'Epic Sales Data'[Sale Day] <= date(2020,7,16)),'Epic Sales Data'[Offer Title]="The Escapists 2"),1,0) = 1),
filter('Epic Sales Data', if(and(and('Epic Sales Data'[Sale Day] >= date(2021,6,17),'Epic Sales Data'[Sale Day] <= date(2021,6,24)),'Epic Sales Data'[Offer Title]="Overcooked! 2"),1,0) = 1)
 
This does not work however, it does if I just reverse the 0 and 1 for The Escpaists 2 but as soon as I do the same for Overcooked 2, the measure no longer works, coming up with a blank value when I set my slicer filter to either of those games. Can anyone help please?
 
 
2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , try like

 

You measure

 

Epic Giveaway Units = calculate(sum('Epic Sales Data'[Net Units]),
filter('Epic Sales Data', not(and(and('Epic Sales Data'[Sale Day] >= date(2020,7,9),'Epic Sales Data'[Sale Day] <= date(2020,7,16)),'Epic Sales Data'[Offer Title]="The Escapists 2"),0,1) && not(and(and('Epic Sales Data'[Sale Day] >= date(2021,6,17),'Epic Sales Data'[Sale Day] <= date(2021,6,24)),'Epic Sales Data'[Offer Title]="Overcooked! 2")) ) )

 

 

 

reverse measure
Epic Giveaway Units = calculate(sum('Epic Sales Data'[Net Units]),
filter('Epic Sales Data', not(not(and(and('Epic Sales Data'[Sale Day] >= date(2020,7,9),'Epic Sales Data'[Sale Day] <= date(2020,7,16)),'Epic Sales Data'[Offer Title]="The Escapists 2"),0,1) && not(and(and('Epic Sales Data'[Sale Day] >= date(2021,6,17),'Epic Sales Data'[Sale Day] <= date(2021,6,24)),'Epic Sales Data'[Offer Title]="Overcooked! 2")) ) ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks for the reply

 

Unfortunately that formula still didn't work and there was a syntax error 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.