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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Dynamic Columns

Hi, I am trying to show based on a slider selection, a diferent measure and column in the same chart. To select a measure I have created a table _MeasureAct with the name of the slicers and then a measure with this:

ID ; Measure

1; Registered

2; Free

 

LineChart_Measure = var med =  min(_MeasureAct[Measure])
return
  switch(true();
    med = "Registered"; [UsersRegistered];
    med = "Free"; [UsersFree]  
  )

 

As they use a different column, I have created another measure to get the corresponding column in axis:

 

Select Col = 
var meas1 =  min(_MeasureAct[Measure])
return
  switch(true();
    meas1 = "Registered"; SELECTCOLUMNS(UseDevSesDay;"Semana";UseDevSesDay[DifWeekUse]);
    meas1 = "Free"; SELECTCOLUMNS(UseDevSesDayVid;"Semana";UseDevSesDayVid[DifWeekUse])  
  )

When I drag to a visualization, it's not possible as it is returning a scalar value (isn't it?)

The problem is that, in the axis, they use a different column from a different table but are calculated in a similar way:

 

UseDevSesDayVid[DifWeekUse]) = datediff(related(DimTimeRegister[Week_StartDate]);related(DimTimeUse[Week_StartDate]);WEEK)
UseDevSesDay[DifWeekUse])= datediff(related(DimTimeRegister[Week_StartDate]);related(DimTimeUse[Week_StartDate]);WEEK)

 and the measures:

Registered = calculate(DISTINCTCOUNT(UseDevSesDay[IdRegistered]); UseDevSesDay[IsRegistered])
Free = calculate(DISTINCTCOUNT(UseDevSesDayVid[IdRegistered]); UseDevSesDayVid[IsRegistered]) 

The key is, when I want to plot a the count of "Free" users, I use as measure Free and as column: UseDevSesDay[DifWeekUse]). Otherwise, if I want to plot the number of Registered Users I use "Registered" measure and UseDevSesDayVid[DifWeekUse]). The only think is that I don't want to draw two plots, instead I want to plot only one, but dynamically. In the other hand, I could do this with bookmarks, but is the last thing I want to do.

Is there any other way to return an entire column dynamically?

Another think, ¿is it possible to compare between those measures with one line chart or bar chart? Anyway, the X axis is the same "legend" (numberweek) but different measure.

 

Lines.png

 

In "A" chart, I'm using UseDevSesDay[DifWeekUse]) as Axis and as values: Free

In "B" chart, I'm using UseDevSesDayVid[DifWeekUse]) as Axis and as values: Registered

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

You should know that calculated column and calculate table can't be affected by any slicer. They are static in the report.
Notice:
1. Calculation column/table not support dynamic changed based on filter or slicer.
2. Measure can be affected by filter/slicer, so you can use it to get dynamic summary result.
here is reference:
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

 

 

Best Regards,

Lin

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

View solution in original post

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

You should know that calculated column and calculate table can't be affected by any slicer. They are static in the report.
Notice:
1. Calculation column/table not support dynamic changed based on filter or slicer.
2. Measure can be affected by filter/slicer, so you can use it to get dynamic summary result.
here is reference:
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/

 

 

Best Regards,

Lin

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

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.