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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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