Hello,
I can’t put pbix file here but I will try to explain it as much as possible.
Goal:
Filter by brand for any Volume Share Change vs Prior Period (Pts) >3, but have volume share and volume share change vs prior period (pts) values remain unchanged (same as before the filter was applied)
Problem:
When filtered, volume share and volume share change vs prior period (pts) recalculate based on the remining values
Notes:
Volume Share = volume sales of brand divided by total volume sales for that time period.
Data Timing: Data is refreshed monthly, but is weekly level data. Data is aggregated to show “Latest 4 Weeks” – a sum of the volume for 4 weeks
If I put a filter
Number changes.
Goal:
Filter by brand for any Volume Share Change vs Prior Period (Pts) >3, but have volume share and volume share change vs prior period (pts) values remain unchanged (same as before the filter was applied)
Here are the formulas:
Volume Share Change vs Prior Period (Pts) =( ( 'Custom Measures'[Volume Share] ) - ( 'Custom Measures'[PP Volume Share] ) ) * 100
Volume Sales =
CALCULATE(
SUM(non_vmi_fact_data_final_history[volume_sales]),
non_vmi_time_meta_data_final_history[Time Period] = "Latest 4 Weeks"
)
----
Volume Share =
VAR Share_of_Category =
CALCULATE (
SUM ( non_vmi_fact_data_final_history[volume_sales] ),
non_vmi_time_meta_data_final_history[Time Period] = "Latest 4 Weeks",
( ALLSELECTED ( non_vmi_product_meta_data_final_history[custom_brand_value] ) )
)
VAR Volume_Sales =
CALCULATE (
SUM ( non_vmi_fact_data_final_history[volume_sales] ),
non_vmi_time_meta_data_final_history[Time Period] = "Latest 4 Weeks"
)
RETURN
ROUNDDOWN ( DIVIDE ( Volume_Sales, Share_of_Category ), 3 )
----
Time Period =
SWITCH (
non_vmi_time_meta_data_final_history[Time Period Calc],
0, "Latest 4 Weeks",
-1, "Latest 4 Weeks",
-2, "Latest 4 Weeks",
-3, "Latest 4 Weeks",
-4, "Prior Period",
-5, "Prior Period",
-6, "Prior Period",
-7, "Prior Period",
-52, "Year Ago",
-53, "Year Ago",
-54, "Year Ago",
-55, "Year Ago"
)
-----
Time Period Calc =
non_vmi_time_meta_data_final_history[time_key]
- MAX ( non_vmi_time_meta_data_final_history[time_key] )
Thanks,
-RK