Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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.

Reply
mkornel
Frequent Visitor

Slicers Don't Work

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!

1 ACCEPTED 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. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

3 REPLIES 3
edhans
Super User
Super User

Can 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.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Sorry for being too vague.

 

See dataset.

DateStoreProductAmount
Feb-1APen10
Feb-1APencil20
Feb-1ANotebook30
Feb-1APaper40
Feb-1BPen10
Feb-1BPencil20
Feb-1BNotebook30
Feb-1BPaper40

...

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. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.