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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ravib
Frequent Visitor

Field Parameters not working for any visual

Hi team, just signed up on this forum. Excited to be here!

I'm trying to use field parameters to choose between metrics I want to display. I know its pretty straightforward since I watched a bunch of youtube videos and read through the MS documentation on how to set it up.

While the field parameter setup works for a table visual (choose a dimension and the field parameter and toggle between the choices to display the chosen metric), I am not able to see the same behavior in ANY of the other visuals....bar chart, pie chart, line chart...anything.

Previously, I was using DirectQuery and I thought field parameters might not work for DirectQuery, but it doesnt work even if I import the data. I have upgraded my desktop to the latest version (Jun 14, 2022), but still nothing.

I don't know if anybody else has encountered this wierd situation. If so, any ideas ?

 

I've attached a PBIX file simple to show you with a simple dataset, how field parameter works for the table, and not for the bar chart.

https://github.com/ravib22/powerbi/blob/main/Test-FieldParam.pbix 

Any hints would be greatly appreciated!!

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @ravib ;

Since the newly generated field parameter Choose Metrics is a text type, the Y-axis requirement in the bar graph is value, which is the number type, so blank will be displayed here.

vyalanwumsft_0-1655973091035.png

vyalanwumsft_1-1655973111215.png
Therefore, the following schemes can be used:

1.create a new table.

Newtable = {
    "UnitsInStock",
    "UnitsOnOrder"}

2.create a measure.

Measure = SWITCH(MAX('Newtable'[Value]),"UnitsInStock",SUM(Products[UnitsInStock]), "UnitsOnOrder",SUM(Products[UnitsOnOrder]))

The final show:

vyalanwumsft_2-1655973195073.pngvyalanwumsft_3-1655973200505.png

vyalanwumsft_4-1655973206480.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi, @ravib ;

Since the newly generated field parameter Choose Metrics is a text type, the Y-axis requirement in the bar graph is value, which is the number type, so blank will be displayed here.

vyalanwumsft_0-1655973091035.png

vyalanwumsft_1-1655973111215.png
Therefore, the following schemes can be used:

1.create a new table.

Newtable = {
    "UnitsInStock",
    "UnitsOnOrder"}

2.create a measure.

Measure = SWITCH(MAX('Newtable'[Value]),"UnitsInStock",SUM(Products[UnitsInStock]), "UnitsOnOrder",SUM(Products[UnitsOnOrder]))

The final show:

vyalanwumsft_2-1655973195073.pngvyalanwumsft_3-1655973200505.png

vyalanwumsft_4-1655973206480.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for taking the time to reply to my question @v-yalanwu-msft . This is awesome.

Another way of doing this is to just create two new measures and add them to the field parameter.

MeasureUIS = SUM(Products[UnitsInStock])

MeasureUIO = SUM(Products[UnitsOnOrder])

This also worked for me.

 

Thanks all for taking interest in answering this q.

ravib

Anonymous
Not applicable

Ya, this is Working like a Magic !!

ravib
Frequent Visitor

Hi @amitchandak , thanks for your reply. But if we do that, then we get a UnitsOnOrder by Count of category name, instead of UnitsOnOrder by CategoryName. The expected outcome is UnitsOnOrder by CategoryName or UnitsInStock by CategoryName. Hope it clarifies.

Thanks.

amitchandak
Super User
Super User

@ravib , choose metrics should be on the y-Axis

 

amitchandak_0-1655356344438.png

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.