Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
Good afternoon
I would be grateful for some help with the following issue.
I have 2 measures Cardcount and Cardpos, which I think I need to make act like two variables and I do not know how.
I need to set each measure to be a value of either "Higher" or "Lower", depending on what I select in a slicer.
I created a table that looks like this
Focus | Conv | Posit |
TSR Issue | Higher | Lower |
Overall Engagement | Lower | Lower |
TSR Engagement | Lower | Higher |
All Good | Higher | Higher |
I created a slicer that uses the values in the Focus column. I created my first measure
Solved! Go to Solution.
Hey @Anonymous ,
I have to admit that I do not fully understand what challenges you have to tackle.
No matter, if you are using a slicer based on the column focus you can use this snippet to create two variables in every measure that you want to "react" on the slicer selection
some measure =
var selectedConv = SELECTEDVALUE( 'Table'[Conv] , BLANK() ) //provide a default value or consider making the focus slider a single selection
var selectedposit = SELECTEDVALUE( 'Table'[Posit] , BLANK() ) //provide a default value or consider making the focus slider a single selection
return
SWITCH(
TRUE()
, selectedConv = "Higher" && selectedposit = "Lower"
, 1 //put you measure definiton here
, selectedConv = "Higher" && selectedposit = "Higher"
, 2
, selectedConv = "Lower" && selectedposit = "Higher"
, 3
, selectedConv = "Lower" && selectedposit = "Lower"
, 4
)
You are not restricted to use SELECTEDVALUE with the column that is used on a slicer, the default value is fired when more than one value is selected inside the slicer or none (meaning all).
Hopefully, this provides an idea on how to tackle your challenge.
Regards,
Tom
Hey @Anonymous ,
I have to admit that I do not fully understand what challenges you have to tackle.
No matter, if you are using a slicer based on the column focus you can use this snippet to create two variables in every measure that you want to "react" on the slicer selection
some measure =
var selectedConv = SELECTEDVALUE( 'Table'[Conv] , BLANK() ) //provide a default value or consider making the focus slider a single selection
var selectedposit = SELECTEDVALUE( 'Table'[Posit] , BLANK() ) //provide a default value or consider making the focus slider a single selection
return
SWITCH(
TRUE()
, selectedConv = "Higher" && selectedposit = "Lower"
, 1 //put you measure definiton here
, selectedConv = "Higher" && selectedposit = "Higher"
, 2
, selectedConv = "Lower" && selectedposit = "Higher"
, 3
, selectedConv = "Lower" && selectedposit = "Lower"
, 4
)
You are not restricted to use SELECTEDVALUE with the column that is used on a slicer, the default value is fired when more than one value is selected inside the slicer or none (meaning all).
Hopefully, this provides an idea on how to tackle your challenge.
Regards,
Tom
Thank you so much for this. It was in the ballpark of what I required so I was able to adapt what you had and make it work. I really appreciate it, thank you for your time.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
142 | |
80 | |
64 | |
52 | |
48 |
User | Count |
---|---|
212 | |
89 | |
79 | |
68 | |
60 |