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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
pauliuseg
Helper I
Helper I

simple multiply columns having empty lines . but BI multiplies sums also

hi,

i have simplified example, just : Sales and discounts. but some discount lines are not existing. so multiplying from zero should be zero.

pauliuseg_0-1622056460285.png

tried to add  column if discount is missing return 0.

so 3 formulas, all calculate rows OK  2126,02 ant 67,75, and zero. But Total is 3966,39  , and should be 2193,77, not 3966,39 (as it total sales multiplies by sum discount which is in total 0.5... )

 

3 formulas tried

Disc Sum = SUM('DB_Sales'[Sales]) * SUM('Disc_table'[Discount])
Sales x Disc = SUM('DB_Sales'[Sales]) * [Discount (if null then 0)] - then it returns zero 🙂
sales x Disc sumx = SUMX('DB_Sales','DB_Sales'[Sales]) * [Discount (if null then 0)]  - this with sumx should work .. but ...
 
what i miss ? should be simple but it's not.... 
thanks a lot ! 
 
 

 

1 ACCEPTED SOLUTION

hi,

finally found, i need to use related 🙂

SUMX('DB_Sales','DB_Sales'[Sales] * RELATED (Disc_table[Discount]) )
and works perfectly :), also i have added additionally a simple key between these tables instead of using more realtions.

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@pauliuseg did you read my previous message, if you need help, you need to provide the details.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@pauliuseg it is important to provide a full picture of how your model is done. I don't why you would use SUM, Share how your model looks like and how these tables are connected. 

 

Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

hi,

finally found, i need to use related 🙂

SUMX('DB_Sales','DB_Sales'[Sales] * RELATED (Disc_table[Discount]) )
and works perfectly :), also i have added additionally a simple key between these tables instead of using more realtions.

i used sum, as it says that i'm refering to column with many values.  even in discount table i left 3 unique records.

i can use max instead of sum, still result is the same - by line it's ok, but total result is wrong.

i know, now i cant  provide, as file too big need to do seperate load, or just multiply in Databse. but did not expected to be it so hard 😄

 

parry2k
Super User
Super User

@pauliuseg try this

 

sales x Disc sumx = SUMX('DB_Sales','DB_Sales'[Sales] * 'DB_Sales'[Discount] )

or

sales x Disc sumx = SUMX('DB_Sales','DB_Sales'[Sales] * COALESCE('DB_Sales'[Discount],0) )

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

hi,

sad, but no, as discount table is different, i need to use some like sum, max or smth.

used sum, even i know thats single value for hat month

sales x Disc sumx n1 = SUMX('DB_Sales','DB_Sales'[Sales] * COALESCE(SUM(Disc_table[Discount]),0) )
sales x Disc sumx n2 = SUMX('DB_Sales','DB_Sales'[Sales] * SUM('Disc_table'[Discount]) )
and the result is the same
pauliuseg_0-1622062567506.png

 

i'm already thinking to do left join in database, and then it will be easy, as there i see some problem is that i'm multiplying with discount table. as everything i multiplied before with sumx was in same table ...

but all works looking at single line 😄

 
 

 

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