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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Analitika
Post Prodigy
Post Prodigy

Wrong calculation in visual in Power BI

Hi,

 

Having trouble calculating sum in Power BI.

Idea is to use either sum1 either sum2 measure depending on data table value.

If data table value is equal to "Taip" then we use sum2, else we use sum2.

I tried this formula:

 

bendra_suma_ar_objektine8 = 
 if(SELECTEDVALUE(_op_kiekis[Objektinė apskaita]) in {"Taip",""}, [Bendra kaina_new],
      [Bendra kaina_new_be_obj]
      
)

 

But it doesn't works. Seems it always use bendra kaina_new_be_obj measure even should be swiped.

Here is a visual:

Analitika_0-1655453820282.png

I marked that output match second column instead of first column.

So how to resolve my issue?

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Does this measure work?

bendra_suma_ar_objektine8 = if(max(_op_kiekis[Objektinė apskaita])="Taip",[Bendra kaina_new],[Bendra kaina_new_be_obj])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Does this measure work?

bendra_suma_ar_objektine8 = if(max(_op_kiekis[Objektinė apskaita])="Taip",[Bendra kaina_new],[Bendra kaina_new_be_obj])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. I cannot use screenshots of your source data.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors