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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
olimilo
Continued Contributor
Continued Contributor

Dynamic X, Y and Legend axis based on slicer?

I have 2 separate tables, connected 1:M via the Test # column. Is it possible to plot them in a single bar visual where the X, Y and Legend are based on the selected value of a Parameter Field? For example, if I select Test Name, it will show the data from the left visual, and if Component Name is selected, it will show the other one.

Sample PBIX: https://file.io/FBmHP0X5zTfV

 

olimilo_0-1729517183774.png

 

Test # Test Name Test Result
1 Test A01 PASS
2 Test A02 FAIL
3 Test A03 PASS
4 Test A04 PASS
5 Test A05 FAIL

 

Component #Test # Component NameComponent Result
1 1 Component APASS
2 1 Component BPASS
3 2 Component AFAIL
4 3 Component CPASS
5 3 Component HPASS
6 4 Component EPASS
7 4 Component FPASS
8 4 Component GPASS
9 5 Component AFAIL
10 5 Component BPASS
4 REPLIES 4
ajohnso2
Continued Contributor
Continued Contributor

test.pbix 

 

Take a look at the attached, pay attention to the model view as I have created a new table and changed relationships along with creating a new measure.

ajohnso2
Continued Contributor
Continued Contributor

 Field Parameters are your friend here, create a new field parameter and drop component and test field in, add a slicer, replace exisiting column axis with the resulting column from the field parameter as your visual axis

FieldParameter.gif

olimilo
Continued Contributor
Continued Contributor

The output doesn't seem correct. If you look at the component visual (top right), Component A and Component B do not match with what is shown in the visual with the field parameter. Again, these are coming from different tables. Most of the examples I see online are using the same table.

 

I tried creating a field parameter for the Axis, Legend and Value fields, but it doesn't seem to show the correct value when selecting the 2nd value (Component Name) in the slicer?

 

Field Parameters

(FP) Axis = 
{
    ("Test Name", NAMEOF('Test'[Test Name]), 0),
    ("Component Name", NAMEOF('Component'[Component Name]), 1)
}

(FP) Legend = {
    ("Test Result", NAMEOF('Test'[Test Result]), 0),
    ("Component Result", NAMEOF('Component'[Component Result]), 1)
}

(FP) Value = 
    {
        ("Tests", NAMEOF('Test'[Tests]), 0),
        ("Components", NAMEOF('Component'[Components]), 1)
    }

 

 

 

Measures

Tests = COUNTROWS('Test')
Components = COUNTROWS('Component')

 

 

olimilo_0-1729568824876.png

 

Visual not showing the correct values (Component Name selected in slicer):

 

olimilo_1-1729568853447.png

 

Hi @olimilo 

 

Did ajohnso2 's method solve your problem? If yes, could you please mark it as solution? This will help more users who are facing the same or similar difficulties. Thank you!

 

If you still have questions, please feel free to ask me.

 

Best Regards,
Yulia Xu

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.