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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Analitika
Post Prodigy
Post Prodigy

Always used same measure despite filtering in measure Power BI

Hello,

 

I would like to ask how fix my issue. I am using formula:

 

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

 

but it returns calculation based on Bendra kaina_new_be_obj. 

 

Analitika_0-1655455047153.png

 

In last column is value "Taip". So according to this it should use Bendra_kaina_new_be_obj.

So how to fix this?

11 REPLIES 11
Anonymous
Not applicable

@Analitika , I believe the measure should be written like this:

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

You will need to replace 'TableName' with the name of the table that contains the [Tapis] column used on the table visual.

No it didn't change. Same result.

Tipas is from Ikainiai table not op_kiekis. Both tables have relationship.

Anonymous
Not applicable

@Analitika try this:

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

Wrong. Need not sum but use one of both measures depending if objektine apskaita equals Taip.

 

If op_kiekis objektine_apskaita equals Taip. then measure 

[Bendra kaina_new] else 
[Bendra kaina_new_be_obj]
Anonymous
Not applicable

I think this version should do it:

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

I said I no need to sumx, sum is already done by bendra kaina

Anonymous
Not applicable

@Analitika , could you please try the measure I suggested and post the results?

Analitika_0-1655460507031.png

Here result last column. So it is wrong result should be as in second column.

Anonymous
Not applicable

@Analitika Could you explain more clearly, please? I don't understand what results you are trying to achieve.

My problem is to calculate according to condition, if objektine apskait ="Taip"

bendra_suma_ar_objektine5 = 
  SWITCH (
      TRUE (),
      MAX(_op_kiekis[taip_ne])=1,[Bendra kaina_new],
       [Bendra kaina_new_be_obj]
      
)

So according to condition it should take measure bendra_kaina_new or 

[Bendra kaina_new_be_obj]. But now seems that rows are wrong. 
Analitika_0-1655466231289.png

I marked rows total is same as last column. But rows values don't match values in first column values. That;s weird total is same but rows are different.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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