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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Rbakker888
Helper II
Helper II

Sumarization issue with DAX formula

I am trying to make some visuals with a formula for revenue where I multiply the revenue by 10 times if the product is a contract, the issue I am having is that it seems to summarize all the revenue from all orders that have that product when one order has that revenue more then 1 time. I have tried using other things then SumX but I cant get it to work or really understand how its going wrong.

My formula for the multiplied revenue:

Order Marge Bedrag € Multiplied test =
SUMX(
    fact_Orders,
    IF (
        fact_Orders[ArtikelCategorie] = "Contract",
        fact_Orders[Order Marge Bedrag €] * 10,
        fact_Orders[Order Marge Bedrag €]
    )
)

My formula for the standard revenue that does work:

Order Marge Bedrag € = [Order Verkoop Bedrag €]-[Order Inkoop Bedrag €]
Just a simple sell - buy price

The sell and buy price columns are a simple Sum of those columns and are correct

Some sample data:
Rbakker888_0-1742808557463.png

The important ones being: Order-ID, Artikelnummer(Articlenumber), Verkoop prijs(Sell price), Inkoop (Buy price)



Rbakker888_2-1742808877602.png

 


This is the result I get from my formula, the right column is correct as you can see and the left one is with my formula but as you can see cause the product was bought 2 times on this order and so for some reason instead of calculating it just for 2 rows it does it for all, also the ones from different orders

1 ACCEPTED SOLUTION

Try the second solution and this

 

SUMX(

Values(Dimension[ArtikelCategorie]),

Calculate( sum(fact_Orders[Order Marge Bedrag €] )) *

 IF (

 Dimension[ArtikelCategorie] = "Contract", 10, 1)

)


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

4 REPLIES 4
Deku
Super User
Super User

This is like due to autoexist, please see this SQLBI video on the topic, and this blog post fro jeffery wang

 

In essence filters on the same table are grouped into tuples. When you remove a filter you remove from the tuple rather than the column, giving unexpected results

 

You have two options

  • Adjust the summarizecolumn() behaviour, as per the article, to Independent 

Deku_0-1742809687907.png

 

  • create a dimension for categories, and use this for your logic. Then the filter are coming from two different tables and autoexist doesn't kick in

Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

@Deku I tried this but changing the Value Filter behaviour doesnt seem to change anything and the second solution also does not seem to work or I am doing it wrong. For the second solution, I just tried to copy the table and then use the column there for the categories.

 

Try the second solution and this

 

SUMX(

Values(Dimension[ArtikelCategorie]),

Calculate( sum(fact_Orders[Order Marge Bedrag €] )) *

 IF (

 Dimension[ArtikelCategorie] = "Contract", 10, 1)

)


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Due to some of how my semantic model is build I had to very slightly edit it but this got me the correct base, thank you.
My final formula:

SUMX(
VALUES(Dimension[ArtikelCategorie]),
CALCULATE( [Order Marge Bedrag €] ) *
IF( SELECTEDVALUE(Dimension[ArtikelCategorie]) = "Contract", 10, 1 )
)

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors