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

Don'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.

Reply
NotSoPowerUser
Frequent Visitor

Dynamic column selection in DAX

Hi,

I am trying to have the user select any data variable for x and y axis to plot out of a large data set 'DataSet'.

The data set got mostly numbers but also strings so some will plot on a x/y scatter chart and some in column chart (but lets leave that alone)

I figures the best way of doing this is to create two new columns which will represent the x and y values. I am also having two unlinked slicers which users can select the variable names from another separate list 'Variable List'. I will be able to lookup the user selection with and expression such as SelectedValue('Variable List'[Column1]). So this is fine so fare.

The DAX expression for the two new columns would have sounded something like this if I could have used INDIRECT formula as in excel i.e.  X-Axis-Data = DataSet [ Indirect ( SelectedValue('Variable List'[Column1]) ) ]

Now I know indirect does not work in Power BI but I figure there must be a way to make a DAX expression with a dynamic reference to another column.

Thanks in advance

1 REPLY 1
lbendlin
Super User
Super User

Look at the new-ish "Personalize Visual"  functionality in Power BI June release. That gives the end user the power to change chart types and data points on the fly.  Very neat in a situation like yours.

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.