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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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