Forum Discussion
Field parameters with normal slicers
Hi, I met a problem, maybe you have solution for this. I have a normal slicer in a page with two values, e.g. 1 and 2. These effect to all visuals on the page. And I use field parameter with 3 measures in a visual in this page: A, B, C. I want to reach the follow cases: Normal slicer slices Field parameters measures: Value 1 selects Measure A, Value 2 selects Measure B and if both of them or none of them are selected is Measure C. I havent got perfect solution yet. The solution with field parameter is important because i need also a dynamically changed measure name in the particular visual. (Of course I can create a new measure with switch function, to choose from three measure based on slicer values, but then the measure name will be fixed in the visual, so its not good solution for me.
Yes, I am aware that this solution might not work for table/matrix.
Only two possible workarounds that I can think of are:
create a switch measure which will dynamically pick the measure based on the condition and implement either of two options
1. Place a text box on top of the measure field in the table visual and for the text box you can give a dynamic measure name as a value.
2. Complete remove the meausre name from the visual and give a dyanamic title to your table visual.
I accepted your connection request on linkedin
Need a Power BI Consultation? Hire me on Upwork
Connect on LinkedIn
Did I answer your question? Mark my post as a solution! If I helped you, click on the Thumbs Up to give Kudos.
Proud to be a Super User!
4 Replies
- tharunkumarRTK
Super User
ssomtom
create a disconnected table with meausre names.Add this column as a slicer in your report page. Then modify all three measures with a conditional clause like this
Measure A = IF( SELECTEDVALUE('Measures Mapping Table'[Key]) = "A", 10 ) Measure B = IF(SELECTEDVALUE('Measures Mapping Table'[Key]) ="B" , 20) Measure C = IF( COUNTROWS(VALUES('Measures Mapping Table'[Key])) = 2 || NOT(ISFILTERED('Measures Mapping Table'[Key])) , 30 )-- replace, 10, 20 and 30 in the above measures with your actual measure definition. And that its.
when you selecte
first measures:
Second measure
Both Meausres:
None selected
I am attaching the PBIX
Need a Power BI Consultation? Hire me on Upwork
Connect on LinkedIn
Did I answer your question? Mark my post as a solution! If I helped you, click on the Thumbs Up to give Kudos.
Proud to be a Super User!
- ssomtomNew Member
Hi, first of all, your solution is amazing for me with beutiful logic.
It's almost perfect for me. I need just a little fixing yet. I would like to use this measure combination with some dimension data, but if I change the visual type to table in your example file, the empty measures got field name with blank result. E.g in this picture I would like to see just Measure C field.
Thank you. (I've connected to you in Linkedin)- tharunkumarRTK
Super User
Yes, I am aware that this solution might not work for table/matrix.
Only two possible workarounds that I can think of are:
create a switch measure which will dynamically pick the measure based on the condition and implement either of two options
1. Place a text box on top of the measure field in the table visual and for the text box you can give a dynamic measure name as a value.
2. Complete remove the meausre name from the visual and give a dyanamic title to your table visual.
I accepted your connection request on linkedin
Need a Power BI Consultation? Hire me on Upwork
Connect on LinkedIn
Did I answer your question? Mark my post as a solution! If I helped you, click on the Thumbs Up to give Kudos.
Proud to be a Super User!
- Ritaf1983
Super User
Hi ssomtom
Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly