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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kpansia
Frequent Visitor

Slicer Not Working as Intended

Hey I have a small sample table example below this. When I am creating visualizations, specifically the stacked column chart, I use a slicer to seperate and count distinct values by year. So If I choose 2012, my visualization should show id 1 = 1 in sales year 2012 and id 2 = 1 in Sales year 2012. Instead it is showing up as id 1 = 3 and id 2 = 1. My understanding is that if it sees atleast one id in 2012 it counts all instances of it within in the table. Does anyone know how to change this?

 

 

id        |   salesYear|

--------------------|

  1       |     2012    |

  1       |     2013    |

  2       |     2012    |

  1       |     2015    |

   

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @kpansia,

I reproduce your scenario and get expected result, please follow the steps below.

1. Create a measure using the formula below.

DistinctCount = COUNT(Table2[id])


2. Create a stacked column chart, select the Id as x-axis, the measure as value. Create a slicer including Year field.

select 2012 yearselect 2012 yearselect 2013 yearselect 2013 year

Please download the .pbix for reviewing more details.

Best Regards,
Angelia

View solution in original post

1 REPLY 1
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @kpansia,

I reproduce your scenario and get expected result, please follow the steps below.

1. Create a measure using the formula below.

DistinctCount = COUNT(Table2[id])


2. Create a stacked column chart, select the Id as x-axis, the measure as value. Create a slicer including Year field.

select 2012 yearselect 2012 yearselect 2013 yearselect 2013 year

Please download the .pbix for reviewing more details.

Best Regards,
Angelia

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.