Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I received a requirement to calculate weighted availability, meaning:
The percentage of total sales in the stores where the selected product is sold, out of the total sales across all stores.
The expression needs to be displayed in two charts:
A Bar chart with Sector as the dimension.
A Line chart with Sector and Year as dimensions.
I was able to create the bar chart using the following expression:
({1<[Material]=P({1<[Product_Division]={'10','12','13','16','26','30','35'}>}[Material]), CustKey=P({<[Customers.Name] -= {"*Marlog*"}, [Customer_H6_Desc.]={'Private'}>} CustKey),
, Year = $::Year>}
[Sales])
/
{1< [Material]=P({1<[Product_Division]={'10','12','13','16','26','30','35','40'}>}[Material]), CustKey = P({1<[Customers.Name] -= {"*Marlog*"}, [Customer_H6_Desc.]={'Private'}>}CustKey), Year = $::Year>}
[Sales]
However, I was not able to make it work properly for the line chart.
There are Three additional constraints:
[Sales] is already a master measure and cannot be modified.
The line chart should ignore Year selection (So the trend will always be visible).
There may be selections on different product levels (Category, Barcode, etc.).
I would appreciate a solution or an alternative expression that might work better in this scenario.
Thanks in advance!
Hi,
The formula works, including for a master measure. I got stuck on trying to use P() and didn’t take a step back to realize that the solution was actually much simpler.
Thanks for the help!
Thank you for the information.