cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sam245gonsalves
Helper I
Helper I

Column Multiplication gives 0

Hello I have the below table with the following columns :

Column 1 is hidden as its sensitive but contains brand. The rows highlighted in Yellow are Brand A & un-highlighted rows are Brand B

 

sam245gonsalves_0-1609778123899.png

 

I tried card sales = value * Qty which worked fine

I have a column Discount value which indicates discount %

 

I want to multiple Card Sales with Discount which is not working correctly

 

Im trying to get the following value: Sales = Card Sales- (Card Sales * Discount_Value) which gives me 0.00 Im not sure why. Please help!

 

The column sales is set to Non Summarized & type Decimal with 4 places

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@sam245gonsalves 

Try create either a column or a measure as below:

Column = [value]*[qty]-([value]*[qty]*[Discount_value])

Measure = 
var cardsales_= SUM([value])*SUM([qty])
Return cardsales_-cardsales_*SUM([Discount_value])

V-pazhen-msft_0-1609915431265.png


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
V-pazhen-msft
Community Support
Community Support

@sam245gonsalves 

Try create either a column or a measure as below:

Column = [value]*[qty]-([value]*[qty]*[Discount_value])

Measure = 
var cardsales_= SUM([value])*SUM([qty])
Return cardsales_-cardsales_*SUM([Discount_value])

V-pazhen-msft_0-1609915431265.png


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

sam245gonsalves
Helper I
Helper I

sam245gonsalves
Helper I
Helper I

@amitchandak  Thank You!! that worked when I created a new measure with the suggested formula, not as accurate though:

 

sam245gonsalves_0-1609779630476.png

<top> 

amitchandak
Super User IV
Super User IV

@sam245gonsalves , if they are from same table try like

 

sumx(Table,[Card Sales]- ([Card Sales] * [Discount_Value]))

 

Else

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.