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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
richard_wylde
Helper IV
Helper IV

Selected Value not displaing

Hello,

 

In this Example  I can successfully show the name chosen in the filter choice using 

 

chosen_column= IF ( isfiltered ( choose_dimension[choice]), VALUES (choose_dimension[choice]), "Not Working" )
 
However if I then wish to reference it in order to choose which column to display then it no longer recognises it -
 
display_chosen_column= if( convert('Query1'[chosen column],STRING) = "Marriage", 'Query1'[Mar_desc], convert('Query1'[choose column],STRING)  )
 
-do you knw why this isn't working ?
 
Thank you
5 REPLIES 5
dax
Community Support
Community Support

Hi @richard_wylde , 

As I know, slicer couldn't affect calculated column, it will work on measure. So you need to use measure to  achieve this goal.

Measure = if( convert('Query1'[also working],STRING) = "Marriage", min('Query1'[Mar_desc]), convert('Query1'[also working],STRING)  )

By the way, I am not clear your expected output, so if possible could you please inform me more detailed information(such as your expected output and your sample data )? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @dax  @Greg_Deckler 

 

thanks for your replies, sorry I wasn't able to explain it clearly - are you able to download this example? 

 

So when I view the following measure in a table it correctly falls into the highlighted green clause, which returns 'Marriage' :-
 
also working = IF ( isfiltered ( choose_dimension[choice]), VALUES ( choose_dimension[choice] ), "Not Working" )
 
However when I reference the result of this measure from within the following measure I can't understand why it is not falling into the green clause. Instead it is returning the red clause, which is the result of the previous measure, however the previous measure is now "Not Working"
 
= if( 'Query1'[also working] = "Marriage", 'Query1'[Mar_desc], 'Query1'[also working] )
 
I hope this makes sense, let me know if there's anything else you need from me,
 
Thank you.
 

Hi @richard_wylde , 

As I mentioned above, calculated column value can't be affect by slicer(even you refer to measure), so the isfilter() in measure(also working) can't work in calculated column(Grrr - why is this not working though?). I suggest you use measure to achieve this goal.

811.PNG

By the way, I want to know when 'Query1'[also working] = "Marriage", what result did you want to get in table?

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi @dax 

 

Thanks for explaining, it's most annoying that a calculated measure can read a slicer value but a calculated column cannot. I need to be able to identify a column chosen by the user, in order to pass the column into other mesures. (I've updated the example   ) - do you know if there is another way to do this ?

 

Thank you

Greg_Deckler
Super User
Super User

Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.