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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jsabo
Helper I
Helper I

DAX to change field/column based on slicer?

Hey guys,

Putting together a project which will mash up our company data with publicly available data from congress. I am putting together a little information section of the report which will have the Name, Party, State etc. of the selected Congressman. But I do not want the text to be populated unless a selection on the filter has been made. I tried the below with a calculated column, but it didn't work:

 

Name_Dynamic = if(COUNTROWS('Legislators - ALL API') > 1, "Select a Congressman", 'Legislators - ALL API'[name])

 

any ideas? Thanks.

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

are using a measure?. This work in a measure not a calculated column




Lima - Peru

View solution in original post

4 REPLIES 4
Vvelarde
Community Champion
Community Champion

hi @jsabo

 

Name_Dynamic = if(COUNTROWS('Legislators - ALL API') > 1, "Select a Congressman", Values ('Legislators - ALL API'[name]))




Lima - Peru

Thanks for the suggestion, @Vvelarde! It just gets stuck as "Select a Congressman" unfortunately... it doesn't change when a selection is made.

Vvelarde
Community Champion
Community Champion

are using a measure?. This work in a measure not a calculated column




Lima - Peru

ah, of course! That worked. Thanks very much!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.