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

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

Reply
Analitika
Post Prodigy
Post Prodigy

Wrong calculating in Power BI

Hello,

 

I would like to ask what I am doing wrong that I always getting same result even I made filtering in measure.

Here is a measure: 

 

bendra_suma_ar_objektine =
IF (SELECTEDVALUE(_op_kiekis[Objektinė apskaita])="Yes",[sum1],[sum2]).
 
Although table op_kiekis table column Objektine_apskaita contains word "Yes", I still getting result like be it used sum2.
 
If contains Yes then sum1, if not then sum2 but I always get result like it used measure sum2. Why it happens?
3 REPLIES 3
Anonymous
Not applicable

@Analitika , can you post some sample data and outputs please.

bendra_suma_ar_objektine5 = 
  SWITCH (
      TRUE (),
      MAX(_op_kiekis[Objektinė apskaita])="Taip",[Bendra kaina_new],
      [Bendra kaina_new_be_obj]
      
)

I am getting same total but somes rows values are different why?

Analitika_0-1655390325689.pngAnalitika_1-1655390362988.png

I am marked rows where is a difference even the total sum is same between first and third columns.

 

Hi @Analitika 

 

You can first refer to this doc: Understanding how Power BI calculates totals

 

"For total and subtotal rows, Power BI evaluates the measure over all rows in the underlying data – it isn't just a simple addition of the values in the visible or displayed rows. This means you can end up with different values in the total row than you might expect." 

 

If your want to sum up all displayed values on the total row, you can use the following measure

new measure = SUMX ( VALUES ( '_op_kiekis'[zur_text] ), [bendra_suma_ar_objektine5] )

You can refer to more examples in this article: https://www.accelebrate.com/library/how-to-articles/power-bi-custom-totals 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
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