Forum Discussion

AndreiK15's avatar
AndreiK15
Icon for Helper II rankHelper II
5 years ago
Solved

Create measure with dynamic filters

I have a table with stores - each store has a format type (ex. STANDARD, MEDIUM, MINI). I have total sales for all stores. I want to create a table with all my stores and their formats and divide each store sales to total for each format type, not total sales for all formats.

 

I have filters for categories. Each store has categories (ex. FOOD, NON-FOOD). When I apply this filter, I want to get sales for each category, divided by total sales for each store.

 

I also want to divide total sales for each category (global), to total sales for each format type (global).

 

So basically I need two measurements:

 

  1. Total sales for each category/total sales for that format
  2. Store sales for category / total store sales

 

This need to be dynamic so the filter must match the store format.

  • SOLVED:

     

    Here's the solution for who's interested:

     

    Category Sales National =
      CALCULATE(SUM(Sales[Sales Net Amt]),ALLEXCEPT(Sites,Sites[Site Type 02]))  - this will give me a total for each site type for each category
     
    Format Sales = CALCULATE(SUM(Sales[Sales Net Amt]),ALLEXCEPT(Sites,Sites[Site Type 02]),REMOVEFILTERS('Merchandise Structure')) - this will give me a total for each site type.
     
    Sorry, I'm new to Power BI. I had this made on Excel, but the file became larger and I had to find a solution with Power BI.
     
    Thank you parry2k !

     

11 Replies