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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
rdurrell
Frequent Visitor

Slicing by state

Hello. I have some data in many different queries for different adjustments I make to a forecast by year. For example, I have data such as this: 

YearAdjustmentState
1100CT
2200CT
3300

CT

 

I have multiple queries for each different state, but all of them are grouped in by state. For example, the above data is for CT, and I may have another one that is for NY, etc.

 

Whenever I try adding a slicer, it does not work. I have created a seperate index with all of my states and linked them to each query, but it still does not work. What am I doing wrong?

 

Thanks

1 ACCEPTED SOLUTION

@rdurrell 

Add the state field from parameter into matrix column. Also please replicate the measure "ADJ" from my file[Alter it as per your field names] and use in matrix values.

NaveenGandhi_0-1720727491901.png

 

View solution in original post

9 REPLIES 9
NaveenGandhi
Super User
Super User

Hi @rdurrell 

Thanks for your question, Can you share sample file and sample output to understand the problem better.

Try to add screenshots of the errors and results that you see as well.

If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

Follow me on LinkedIn!!!

Sure. 

 

Screenshot 2024-07-11 143012.pngScreenshot 2024-07-11 143050.png

When I click my slicer, nothing happens. What is my issue? I have relationships between my slicer and the columns. Each column value is associated with a state as in my example data table above, but I cannot slice by state.

@rdurrell 

Slicer filters on each row line level and not on column level, I..e you can add year as a slicer and select year 1 to see year 1 data for CT, MA, NH.

I have attached a POC PBIX which might be helpful for you. I have used field parameter and a measure to achieve this.

Let me know if this is what you are looking for.


If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

Follow me on LinkedIn!!!

So what you did was you created a new table with:

[State Parameter ] = {
    ("CT", NAMEOF('CT'[State]), 0),
    ("NY", NAMEOF('NY'[State]), 1)
}
 
And then created a field parameter?

@rdurrell 
When you create field parameter the table is automatically created.

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters.

If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate you kudos!!

Follow me on LinkedIn!!!


I am confused. What was your first step? Creating a field parameter? With which fields?

@rdurrell 

Try creating a field parameter using all the fields you want to include.

NaveenGandhi_0-1720726282089.png

 

I have done that now, but it still won't filter. When I click on "CT" for example nothing happens. Is there another step?

@rdurrell 

Add the state field from parameter into matrix column. Also please replicate the measure "ADJ" from my file[Alter it as per your field names] and use in matrix values.

NaveenGandhi_0-1720727491901.png

 

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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