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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
deloitte_jogonz
Regular Visitor

How to get the products that have increased their sales?

Hi everyone, I hope you are great.

Getting to the point, I have this dataset:

 

YEAR        MONTH        PRODUCT_NAME        SALES

2018        January          Black Jeans                   100

2018        January          Blue Jeans                     200

2018        January          White Jeans                  300

2019        January          Black Jeans                   200

2019        January          Blue Jeans                    150

2019        January          White Jeans                  500

 

I need to know the quantity of products that have increased their sales.

In this example dataset, it'd be:

QuantityWIncreasedSales = 2

Black Jeans 100 -> 200

* Increase of 100 $

* Increase of 100%

 

White Jeans 300 -> 500

*Increase of 200$

*Increase of 67%

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

Hi @deloitte_jogonz ,

 

I've created a sample as your requested, then add below measures to generate the results:

Increase% = var a = CALCULATE(MAX('Table'[ SALES]),FILTER(ALL('Table'),[YEAR]=2018),VALUES('Table'[MONTH]),VALUES('Table'[PRODUCT_NAME]))
var b = CALCULATE(MAX('Table'[ SALES]),FILTER(ALL('Table'),[YEAR]=2019),VALUES('Table'[MONTH]),VALUES('Table'[PRODUCT_NAME]))
var c= CALCULATE(b-a,ALL('Table'))
Return
IF(c>=0,DIVIDE(c,a),BLANK())
QuantityWIncreasedSales = CALCULATE(DISTINCTCOUNT('Table'[PRODUCT_NAME]),FILTER('Table',[Increase%]<>BLANK()))

01.PNG

Pbix attached here: 

 

https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/Efe0Sy2yo1xIicxelyapN6...

 

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

1 REPLY 1
v-diye-msft
Community Support
Community Support

Hi @deloitte_jogonz ,

 

I've created a sample as your requested, then add below measures to generate the results:

Increase% = var a = CALCULATE(MAX('Table'[ SALES]),FILTER(ALL('Table'),[YEAR]=2018),VALUES('Table'[MONTH]),VALUES('Table'[PRODUCT_NAME]))
var b = CALCULATE(MAX('Table'[ SALES]),FILTER(ALL('Table'),[YEAR]=2019),VALUES('Table'[MONTH]),VALUES('Table'[PRODUCT_NAME]))
var c= CALCULATE(b-a,ALL('Table'))
Return
IF(c>=0,DIVIDE(c,a),BLANK())
QuantityWIncreasedSales = CALCULATE(DISTINCTCOUNT('Table'[PRODUCT_NAME]),FILTER('Table',[Increase%]<>BLANK()))

01.PNG

Pbix attached here: 

 

https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/Efe0Sy2yo1xIicxelyapN6...

 

Best regards,

Dina Ye

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.