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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Tomek1982
Helper I
Helper I

wrong total of measure

Calculation of a total for measures seems to be extensively commented, however I can not solve my issue.
There is following table:

Tomek1982_0-1666552227165.png

where:

Wartość jednostek = MAX('Table1'[wycena]) * 'Table2'[Running ilosc jednostek]

I understand that this way Total of "Wartosc jednostek" (104318) = Max of wycena (592) * Sum of "Running ilosc jednostek" (176), but this is not what I expect.

How can I calculate Total value to be arround 33k?

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Tomek1982 

 

You can try the following methods.

Measure =
IF (
    HASONEVALUE ( Table1[Column1] ),
    [Wartość jednostek],
    SUMX ( Table1, [Wartość jednostek] )
)

vzhangti_0-1666684772980.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @Tomek1982 

 

You can try the following methods.

Measure =
IF (
    HASONEVALUE ( Table1[Column1] ),
    [Wartość jednostek],
    SUMX ( Table1, [Wartość jednostek] )
)

vzhangti_0-1666684772980.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

latimeria
Solution Specialist
Solution Specialist

Hi @Tomek1982 ,

 

You need to make a different calculation at total level.

Try something like this:

If (isinscope('Table1'[Column1], // unique value at line level
   MAX('Table1'[wycena]) * 'Table2'[Running ilosc jednostek],
   calculate (total level)
)



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.