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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Kenzaobd99
New Member

Need help with adding a new field parameter based on a specific category

Hello Power BI community,

I'm facing an issue with adding a new field parameter to my existing list in Power BI Country.pbix . Currently, I have a fields parameter that I use in visuals and visual filters to filter data based on the file I choose. First here's my table :  

Kenzaobd99_0-1714281634025.jpeg

Here is a snippet of my existing parameter: 

 

Kenzaobd99_1-1714281672363.jpeg

and it's used like this in visuals with diff metrics  

 

Kenzaobd99_2-1714281704404.jpeg

Kenzaobd99_3-1714281740442.jpeg

 

Now, I want to add a new parameter based on the category column from the table, meaning that when I choose Country from the filter the table gives me names with category "Country". I tried the following by specifying the category name but it didn't work when I select it from the filter it doesn't exclude the other that aren't countries: 

 

Kenzaobd99_4-1714281774818.jpeg

 

Kenzaobd99_5-1714281785124.jpeg

Could someone please help me to achieve this? Any suggestions or guidance would be greatly appreciated. 

Thank you in advance! 

2 ACCEPTED SOLUTIONS
samratpbi
Responsive Resident
Responsive Resident

Hi, I think what you can do is create a calculated column that will have Country categories only.

Country = CALCULATE(VALUES(F_Param[Category]), F_Param[Category] = "Country")
Then create a field parameter using all 3 columns.
field_param = {
    ("Name", NAMEOF('F_Param'[Name]), 0),
    ("Category", NAMEOF('F_Param'[Category]), 1),
    ("Country", NAMEOF('F_Param'[Country]), 2)
}
 
If this helps to resolve your problem then please mark it as solution, Thanks!

View solution in original post

ThxAlot
Super User
Super User

In MS official documentation, it reads as follows,

Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn

... if you want to add a new field to an existing parameter, ... and match the format shown in this example.

Parameter = {
    ("Customer", NAMEOF('Customer'[Customer]), 0),
    ("Category", NAMEOF('Product'[Category]), 1),
    ("Color", NAMEOF('Product'[Color]), 2),
    ("Product", NAMEOF('Product'[Product]), 3)
}

 

So, your expression might not be recognizable in a field parameter table. 



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
ThxAlot
Super User
Super User

In MS official documentation, it reads as follows,

Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn

... if you want to add a new field to an existing parameter, ... and match the format shown in this example.

Parameter = {
    ("Customer", NAMEOF('Customer'[Customer]), 0),
    ("Category", NAMEOF('Product'[Category]), 1),
    ("Color", NAMEOF('Product'[Color]), 2),
    ("Product", NAMEOF('Product'[Product]), 3)
}

 

So, your expression might not be recognizable in a field parameter table. 



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



samratpbi
Responsive Resident
Responsive Resident

Hi, I think what you can do is create a calculated column that will have Country categories only.

Country = CALCULATE(VALUES(F_Param[Category]), F_Param[Category] = "Country")
Then create a field parameter using all 3 columns.
field_param = {
    ("Name", NAMEOF('F_Param'[Name]), 0),
    ("Category", NAMEOF('F_Param'[Category]), 1),
    ("Country", NAMEOF('F_Param'[Country]), 2)
}
 
If this helps to resolve your problem then please mark it as solution, Thanks!

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.