Search code examples
powerbidaxvisualizationdata-analysis

Power BI - drill down on line chart


I have a table such as below in Power BI. I want to create a line chart that drills Animal-> Subcategory. I have Date in the x axis, Value in the y-axis and Animal in the legend field. I can add another field to the legend field. Does anybody know how I can do that?

I also have an Animal filter at the top, when selecting an animal, it would be nice if the chart would automatically update to show the subcategory

Date Animal Subcategory Value
2024-01 Cat Siamese 100
2024-01 Cat Persian 150
2024-01 Dog Bulldog 200
2024-01 Dog Beagle 250
2024-01 Bird Parrot 300
2024-02 Bird Sparrow 350

Solution

  • This can be done using a Field Parameter. It will need to be enabled before it can be used. Steps to enable it can be found here.

    Create a new Field Parameter and add Animal and Subcategory to it.

    Field Parameter

    Add this new Field Parameter to the Legend of your visual. Use the autogenerated slicer to switch between Animal and Subcategory.

    Visual

    Subcategory Selected:

    Subcategory Selected