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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
LeaRupnik
Helper III
Helper III

exemple sum

Hello, 

 

i have a problem, with sum and thant vhat a have too give in a table in powerBI. 

I have a formula in SSAA:

PLAN NAB PREMIJA VRED:=CALCULATE([SumPlan_nab_premija]*[SumPlan_kol]/1000;
FILTER ( ALL ('cisppr cista_prodajna_premija'); 'cisppr cista_prodajna_premija'[datum_posnetka] = MAX('cisppr cista_prodajna_premija'[datum_posnetka]));
VALUES('cisppr cista_prodajna_premija'[Nivo 1]);
VALUES('cisppr cista_prodajna_premija'[Nivo 2]);
VALUES('cisppr cista_prodajna_premija'[Nivo 3]);
VALUES('cisppr cista_prodajna_premija'[Nivo 4]);
VALUES('cisppr cista_prodajna_premija'[mesec]);
VALUES('cisppr cista_prodajna_premija'[leto])
)

 

than table in PowerBI:

LeaRupnik_0-1605851065736.png

the nivo 4 is ok, nivo 3, nivo 2 and nivo 1 a would like that is sum nivo 3 sum (nivo4) and so one. 

 

Please help. 

 

thx

LEa

 

 

4 REPLIES 4
d_gosbell
Super User
Super User

This sounds like an order of operations issue. Currently the code is summing the two measures, then doing the multiplication and division and it sounds like you want it to do the multiplication and division first then sum up the results.

 

You could achieve this by doing a SUMX over the values in [Sistem naziv enote] (assuming that is the lowest level that you want the values calculated at)

 

eg.

 

REAL NAB PREMIJA VRED v2 = 
var maxDatum = MAX('fact (2)'[datum_posnetka])
return CALCULATE(
    SUMX( VALUES('fact (2)'[Sistem naziv enote]),
    [SumReal_nab_premija]*[REAL NAB KOL]/1000)
        , 'fact (2)'[datum_posnetka] = maxDatum )

 

LeaRupnik
Helper III
Helper III

I have a very big data model (data are secure). My question is how to use different formula (measure- DAX) in the same column for different levels.

 

thx

Lea

v-xuding-msft
Community Support
Community Support

Hi @LeaRupnik ,

 

Can you please share some sample data? We will understand your requirement more clearly. Thanks!

 

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

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.