Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
I need help to create formula which would be responsive to slicers.
|Date|Store|Prodcut|Qty|
|Feb-1|A|A|10|
|Feb-1|A|B|20|
|Feb-1|A|C|30|
|Feb-1|A|D|40|
|Feb-2|B|A|1|
|Feb-2|B|B|2|
|Feb-2|B|C|3|
|Feb-2|B|D|4|
FORMULA = (SUM(Product A) + SUM(Product B)) / (SUM(Product C) + SUM(Product D))
I have two slicers: Store and Product. Store is working, but Product is not. I guess its because I'm using it as a part of the formula, but I don't know how to fix this.
I would appreciate any help here! Thanks in advance!
Solved! Go to Solution.
Ok. See if this is what you want. See the attached PBIX file. Please note the formula will not work unless you have Pen and/or Pencil selected and Paper and/or Notebook. In other words, if you only select Pen and Pencil, the formula returns nothing because there is no denominator.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCan you explain exactly what it is you are doing? Your formula isn't valid. SUM() requires a column name, and Product A, Product B, etc. are not column names.
Slicers will definitly work if you are using fields in your table as measures. I just need to understand your goal here.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingSorry for being too vague.
See dataset.
Date | Store | Product | Amount |
Feb-1 | A | Pen | 10 |
Feb-1 | A | Pencil | 20 |
Feb-1 | A | Notebook | 30 |
Feb-1 | A | Paper | 40 |
Feb-1 | B | Pen | 10 |
Feb-1 | B | Pencil | 20 |
Feb-1 | B | Notebook | 30 |
Feb-1 | B | Paper | 40 |
...
EXCEL FORMULA = ( SUMIF(Product,"Pen",Amount) + SUMIF(Product,"Pencil",Amount) ) / ( SUMIF(Product,"Notebook",Amount) + SUMIF(Product,"Paper",Amount) )
GOAL - I want to have two slicers: store and product. Both should affect formula, e.g. unselecting "Pen" should set 0 amount in formula for "Pen"
Ok. See if this is what you want. See the attached PBIX file. Please note the formula will not work unless you have Pen and/or Pencil selected and Paper and/or Notebook. In other words, if you only select Pen and Pencil, the formula returns nothing because there is no denominator.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThis is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
78 | |
76 | |
59 | |
36 | |
33 |
User | Count |
---|---|
100 | |
62 | |
56 | |
47 | |
41 |