cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anikah Regular Visitor
Regular Visitor

How to find differences between sales value based on product type column and category column

Hello,

 

I want to find sales value difference between the product and  category.

for eg :

(product A and category 0) has $100 sales and the (product B and category 0) has $50 then the reult in difference coulmn would be 50. Screen shot below with yellowhighlighted column.  Thanks in advance.

 

Screenshot.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to find differences between sales value based on product type column and category column

Hi,

 

Try this calculated column formula

 

=ABS([Sales]-CALCULATE(SUM([Sales],FILTER(Data,Data[Category]=EARLIER(Data[Category])&&Data[Product]<>EARLIER(Data[Product]))))

 

Hope this helps.

3 REPLIES 3
Super User
Super User

Re: How to find differences between sales value based on product type column and category column

Hi,

 

Try this calculated column formula

 

=ABS([Sales]-CALCULATE(SUM([Sales],FILTER(Data,Data[Category]=EARLIER(Data[Category])&&Data[Product]<>EARLIER(Data[Product]))))

 

Hope this helps.

anikah Regular Visitor
Regular Visitor

Re: How to find differences between sales value based on product type column and category column

Thanks for the response Ashish...

Super User
Super User

Re: How to find differences between sales value based on product type column and category column

You are welcome.

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 30 members 875 guests
Please welcome our newest community members: