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
Visiblo
Frequent Visitor

Reset Dynamic Legend with Field Parameters

Hi,

I created a Field Parameter (New Feature from May 2022) with a few dimensions (example: Country, OS, Product Name, etc.) to use as a Legend in a line chart. I use Chiclet Slicers (https://appsource.microsoft.com/en-us/product/power-bi-visuals/wa104380756?tab=overview) to select the dimension I want to see as the legend. While this methodology works, I'm looking for a way to have the that same chart without a legend as its default stage, then be able to click on these slicers to have a dynamic legend. In other words, I want to be able to go back and forth from 1 line (total) to whichever dimension I use in the slicer (multiple lines). I tried playing with the multiple selection settings but it would use the last slicer even by unselecting/select all. 

 

Thanks!

1 ACCEPTED SOLUTION

Hi @Visiblo 

 

I found a workaround. You can add the following measure in the model for none legend field. It returns blank value. 

None Field = BLANK()

 

Then add this measure to your field parameter. For example,

Legend Field = {
    ("None", NAMEOF([None Field]), 0),
    ("Product", NAMEOF('Table'[Product]), 1),
    ("Region", NAMEOF('Table'[Region]), 2)
}

vjingzhang_0-1658484575473.png

 

When selecting the None option, it displays all data without legend in the line chart. However, a weakness is that this added field cannot be used as the default option when no field is selected. It still selects the last non-blank field when no field is selected. There is no default option currently. 

 

Here is one limitation it has currently:

  • There's no way for your report users to select "none" or no fields option. Selecting no fields in the slicer or filter card is the same as selecting all fields.

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

3 REPLIES 3
Visiblo
Frequent Visitor

Hi, please find attached 2 pictures of the desired states for the line chart. 
1. Total when nothing in the dynamic legend is selected. This currently doesn't work even without a dimension being selected in the chiclet slicer. It displays the last legend dimension selected.

Total Screenshot.png
2. Dynamic Legend where 'Region' is selected
Legend Screenshot.png

 

Does that help? I could add a fixed column to my table with "Total", then add it to the field parameters but I was wondering if there was a more elegant way to do this. 

Hi @Visiblo 

 

I found a workaround. You can add the following measure in the model for none legend field. It returns blank value. 

None Field = BLANK()

 

Then add this measure to your field parameter. For example,

Legend Field = {
    ("None", NAMEOF([None Field]), 0),
    ("Product", NAMEOF('Table'[Product]), 1),
    ("Region", NAMEOF('Table'[Region]), 2)
}

vjingzhang_0-1658484575473.png

 

When selecting the None option, it displays all data without legend in the line chart. However, a weakness is that this added field cannot be used as the default option when no field is selected. It still selects the last non-blank field when no field is selected. There is no default option currently. 

 

Here is one limitation it has currently:

  • There's no way for your report users to select "none" or no fields option. Selecting no fields in the slicer or filter card is the same as selecting all fields.

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

amitchandak
Super User
Super User

@Visiblo ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.


Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.