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
Chrispi85
Frequent Visitor

Product Price Level Evaluation

Hey there, 

 

I am not new to Power BI and feel like this should be an easy task but I'm stuck somehow. Maybe I just google it wrong but can't seem to find anything similar on the web so my hopes are on you. 

 

I got a table with a history of prices from different platforms like this:

 

Chrispi85_0-1678808805114.png

 

This includes prices from my companys online shop as well, so if its my own product, platform will be 'OwnShop'.

 

There are several prices on each platform for the same products on the same date. 

 

Now I need Measures to find out: 

 

  • how many of the products on each platform are best priced - so something like Count IDs where Price = minimum price  -  Calculate(count(ID),price=min(price))
  • percentage of best priced products for each platform

Any ideas? Help is much appreciated!

 

Thanks 

Chris

 

 

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @Chrispi85 ,

 

Here're the measures.

Returns the minimum price for each platform.

Min Price = CALCULATE(MIN('Table'[Price]),FILTER(ALLSELECTED('Table'),[Platform]=MAX('Table'[Platform])))

Counts the products on each platform are best priced.

Count = CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(ALLSELECTED('Table'),[Platform]=MAX('Table'[Platform])&&[Price]=[Min Price]))

Percentage of best priced products for each platform.

Percentage = var _all=CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(ALLSELECTED('Table'),[Platform]=MAX('Table'[Platform])))
return DIVIDE([Count],_all)

vstephenmsft_0-1678950439056.png

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Hi Stephen,

 

thank you so much for the effort! I feel a bit lazy right now, that I actually posted a Screenshot and not a real table, so you had to newly build it...

 

Regarding your answer - It's not quite what I'm looking for. I need the min price for each product, not for the whole platform. So if the IDs where all the same 0.45 would be the min price for that ID. In the sample there should be other min prices for the other IDs i.e. 1.00 for 23093818.

 

Now again I'm posting a Screenshot 🙄  it's for my expected result: 

Chrispi85_0-1678954857196.png

Now, I kind of solved the problem by creating a new table in which I pivoted my Platform column and added columns for

  1. best price,
  2. a variable that shows on which platform the best price was found 
  3. and a binary that shows if there were found any products on other platforms. 

This solves the problem for now but I don't think it's a very elegant way to do this. Anyway I feel like I will have to provide more specific details for the problem to help you find the elegant solution, so when I have time I will post here again with a pbix. 

 

Until then - should I close the topic by accepting the solution or do nothing? 

 

 

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.