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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JanD
Frequent Visitor

Price analysis / complex DAX

Hey there!

 

I have a bit of challenge here.

Working on price anaysis of a portfolio.

I need to define what is the price increase of my portfolio for all products appearing in both time periods AY and LY and what is the mix effect of old products appearing only in LY and new ones only in AY.

 

I have my calculation in Excel, but I have difficulties replicate in PowerBI..

 

Here is the excel file with data , my increase calculation and PowerBI connected to it.

https://drive.google.com/drive/folders/1nbJ52LUm4vegL5YmEG14NCcWozXRyqjO?usp=sharing

 

This should be the outcome of analysis per market or any selection that can be made (excel file, sheet1).

 

JanD_0-1640734405934.png

 

Could anybody help me? Appreciate any help!!

Thanks a lot

Jan

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

All measures are in the attached pbix file.

 

 

Picture1.png

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

All measures are in the attached pbix file.

 

 

Picture1.png

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi @Jihwan_Kim

 

It is exactly what I needed. Thanks a lot!

Basically I managed to get the same result, but in much complicated way, plus using bigger database I started having performance issues.

 

My solution looked like this:

 

Increase base old help =
IF ( [SalesAY] && [SalesLY] > 0, [QuantityLY], 0 )

 

Increase base old =
CALCULATE (
    [QuantityLY],
    FILTER ( VALUES ( data[Product] ), [SalesAY] && [SalesLY] > 0 )
)

 

Price delta old =
( [SalesAY] / [QuantityAY] - [SalesLY] / [QuantityLY] ) / ( [SalesLY] / [QuantityLY] )

 

Proportional increase old help =
IFERROR (
[Price delta old] * [Increase base help Old]
/ CALCULATE ( [Increase base old], ALLSELECTED ( data[Product] ) ),
0
)
 
Proportional increase old =
SUMX ( VALUES ( data[Product] ), [Proportional increase help old] )

 

 

I had to use 5 steps instead of your 3. I was fighting with summarizing my values in a proper, correct way. Additionally looks like formula Values makes the calculation much slower.

Nevertheless your solution really helped. (y)

Can you recommend a source for learning DAX? I have gone through all related to DAX on microsoft websites, but still couldn't built such an efficient calculation as you did. 🙂

 

JanD_0-1640793801351.png

 

Thanks
Jan

 

 

Hi, 

Thank you for your feedback.

Many people say reading the book, "The Definitive Guide to DAX", may let you level up in developing Power BI reports. I also agree with them. It is not a beginner-level-book but it will surely bring your skills up to the next level.

Thanks.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors