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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Analitika
Post Prodigy
Post Prodigy

Incorrect calculation in Power BI

Hello,

 

I would like to ask how to calculate if column contains Taip. I used this formula:

 

bendra_suma_ar_objektine7 = 
  SWITCH (
      TRUE (),
      MAX('_op_kiekis'[ZU0_KOD])="Objektinė apskaita" &&  MAX('_op_kiekis'[Objektinė apskaita])="Taip",[Bendra kaina_new],
      [Bendra kaina_new_be_obj]
      
)

 

but despite the value in objektine apskaita, all time bendra kaina_new_be_obj is being used. So how to fix it?

Analitika_0-1655452491828.png

I marked matched but is not ok, it should calculated  like in first column. In this last column total must match first or third column total.

 

1 REPLY 1
Anonymous
Not applicable

Hi @Analitika ,

According to the data inside the screenshot you provided, the calculation is correct.  There is only one record (the part circled in red) that meets the condition (MAX('_op_kiekis'[ZU0_KOD])="Objektinė apskaita" && MAX('_op_kiekis'[Objektinė apskaita])="Taip"). Then take the value of the measure [Bendra kaina_new], which is 0. Other records that do not meet the condition take the value of the mesure [Bendra kaina_new_be_obj] respectively.

yingyinr_1-1655691245911.png

Best Regards

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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