The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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:
The important ones being: Order-ID, Artikelnummer(Articlenumber), Verkoop prijs(Sell price), Inkoop (Buy price)
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
Solved! Go to Solution.
Try the second solution and this
SUMX(
Values(Dimension[ArtikelCategorie]),
Calculate( sum(fact_Orders[Order Marge Bedrag €] )) *
IF (
Dimension[ArtikelCategorie] = "Contract", 10, 1)
)
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
@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)
)
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 )
)