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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Sunkari
Responsive Resident
Responsive Resident

Changing metric dynamically in chart.

Hi All,

I have two tables. One is fact table which contains different metrics(Budget, SalesAmount) and another one is the static table which has a single column of metric names.

 

Here comes  requirement,

1) Need to add slicer which contains metric names.

2) Bar chart which metric. By default, it will show the data for the budget. We should have the capability to change bar chart metric based on the slicer.

Please provide your best possible solution for this. 

 

 

 

 

 

 

2 ACCEPTED SOLUTIONS
Sunkari
Responsive Resident
Responsive Resident

Parameter table is one approach I am aware of it. http://www.daxpatterns.com/parameter-table/

 

 

View solution in original post

Eric_Zhang
Microsoft Employee
Microsoft Employee


@Sunkari wrote:

Hi All,

I have two tables. One is fact table which contains different metrics(Budget, SalesAmount) and another one is the static table which has a single column of metric names.

 

Here comes  requirement,

1) Need to add slicer which contains metric names.

2) Bar chart which metric. By default, it will show the data for the budget. We should have the capability to change bar chart metric based on the slicer.

Please provide your best possible solution for this.  


I think a workaround can be using a measure like below. The table Metrics is the table containing measure names.

 

Measure =
IF (
    ISFILTERED ( Metrics[Name] ),
    SWITCH (
        TRUE (),
        LASTNONBLANK ( Metrics[Name], "" ) = "Measure1", [Measure1],
        LASTNONBLANK ( Metrics[Name], "" ) = "Measure2", [Measure2],
        [Other measure]
    ),
    [A default measure]
)

 

View solution in original post

2 REPLIES 2
Eric_Zhang
Microsoft Employee
Microsoft Employee


@Sunkari wrote:

Hi All,

I have two tables. One is fact table which contains different metrics(Budget, SalesAmount) and another one is the static table which has a single column of metric names.

 

Here comes  requirement,

1) Need to add slicer which contains metric names.

2) Bar chart which metric. By default, it will show the data for the budget. We should have the capability to change bar chart metric based on the slicer.

Please provide your best possible solution for this.  


I think a workaround can be using a measure like below. The table Metrics is the table containing measure names.

 

Measure =
IF (
    ISFILTERED ( Metrics[Name] ),
    SWITCH (
        TRUE (),
        LASTNONBLANK ( Metrics[Name], "" ) = "Measure1", [Measure1],
        LASTNONBLANK ( Metrics[Name], "" ) = "Measure2", [Measure2],
        [Other measure]
    ),
    [A default measure]
)

 

Sunkari
Responsive Resident
Responsive Resident

Parameter table is one approach I am aware of it. http://www.daxpatterns.com/parameter-table/

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.