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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Simondeb
Frequent Visitor

Sum If calculation problem

Dear all,

 

I have trouble sutting my formul to have a sum the take into consideration my filters :

Simul2 = if(Region[Opportunity type]="Simul";
CALCULATE(sum(Region[Value Impact]);
filter(Region;Region[Region code]=EARLIER(Region[Region code]));
filter(Region;Region[Region Libelle]=SELECTEDVALUE(Region[Region Libelle]));
filter(Region;Region[Phasing]=SELECTEDVALUE(Region[Phasing]));
filter(Region;Region[Status]=SELECTEDVALUE(Region[Status])));0)
 

Capture.PNG

 

I need the opportunity type line = simul to show me the result of 608393-733960 = -125567

If I filter on Won, in need this same line to give 608393 only.
 
Can you help me??
 
Thanks you,
 
Simon
5 REPLIES 5
dax
Community Support
Community Support

Hi @Simondeb , 

According to your description, it seems that you are creating calculated column, and it seems that you want to use filter and slicer to control its value, right? 

As I know, we can't use slicer and filter to control calculated column' value. So you need to use measure to achieve this goal. By the way, if possible, could you please inform me more detailed information(such as your expected output and your sample data, you could upload virtual data instead of real data as sample)? Then I will help you more correctly.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

You are mixing column and measure calculations. You can try a measure like. You do not need handle filter unless you want change behaviour

Simul2 = 
var _sel = SELECTEDVALUE(Region[Opportunity type])

Switch(true(),
_sel="Simul"; CALCULATE(sum(Region[Value Impact]),allexcept(Region[Region code]))
_sel="Won"; CALCULATE(sum(Region[Value Impact]))
)
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
Greg_Deckler
Community Champion
Community Champion

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi Thanks for the tip but cannot give sample as it is professional private data...

@Simondeb - We don't need the actual data, we just need enough sample/example data the emulates the problem. It's usually less than 10 rows. In table text within the forum is preferred. A link to an Excel or CSV or PBIX file next. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors