Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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!!
Solved! Go to Solution.
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.
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:
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.
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.
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:
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
Ya, this is Working like a Magic !!
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.
@ravib , choose metrics should be on the y-Axis
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.