Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
I have only one column in my table i.e., Alphabet column. I have placed it into a slicer and enabled select all option.
I would like to show the explanation of these alphabets in card. I want that "Explanation" i.e., the second table of column as a calculative column.
If i select "A" then it should diplay "This is the 1st alphabet"
If i select "B" then it should diplay "This is the 2nd alphabet"
If i select "C" then it should diplay "This is the 3rd alphabet"
If i select "Select All" then it should diplay "Please select any one alphabet"
Thanks in advance
Solved! Go to Solution.
Hi @Anonymous ,
How is this?
First, add a [index] column or a sorting coulmn.
(If you use conditional functions, such as IF or SWITCH. It can be cumbersome when you have too many rows.)
Then, Create a measure like this:
Measure 3 =
VAR x = MAX('Table'[Index])
RETURN
IF(
ISFILTERED('Table'[Alphabet]),
"This is the" & " " & x & " " & "alphabet",
"Please select any one alphabet"
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Good point - the table[column] needs to be wrapped in a VALUES() function when in a measure.
ie. SWITCH( VALUES('Alphabet Table'[Alphabet]), etc etc
Though of course @v-lionel-msft response is a great answer for all instances of the alphabet!
Hi @Anonymous ,
How is this?
First, add a [index] column or a sorting coulmn.
(If you use conditional functions, such as IF or SWITCH. It can be cumbersome when you have too many rows.)
Then, Create a measure like this:
Measure 3 =
VAR x = MAX('Table'[Index])
RETURN
IF(
ISFILTERED('Table'[Alphabet]),
"This is the" & " " & x & " " & "alphabet",
"Please select any one alphabet"
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Try below.
do a Index column and a measure",
/Adam
You want to create a measure (not a calculated column) with the formula using a SWITCH / IF statements plus a test for SELECTEDVALUE or use IF(HASONEVALUE() or perhaps IF(HASONEFILTER() depending on what you need. E.g.
Alphabet =
IF(HASONEVALUE('Table'[Column1]),
SWITCH( 'Table'[Column1],
"A", "This is the 1st alphabet",
"B", "This is the 2nd alphabet",
"This is all other values"
),
"Please select any one alphabet"
)
Hi @Anonymous ,
Thanks for your replly but second line is showing error. It is expecting a measure value at the line of error.
If you look closely at your code you'll see you entered a table name on its own. My code showed table[column] in the first argument to the SWITCH statement.
Hopefully you've found the solution anyway from the other posts.
Hi @Anonymous ,
Thanks for helping me out but kust now i tried wit sample data and i tried to give colun name but it is not acceptingn it.
Note:Yes as you mentioned however we got solution from another post but anyway thanks for helping me out.
Thanks
Good point - the table[column] needs to be wrapped in a VALUES() function when in a measure.
ie. SWITCH( VALUES('Alphabet Table'[Alphabet]), etc etc
Though of course @v-lionel-msft response is a great answer for all instances of the alphabet!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
99 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |