cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
danimelv Regular Visitor
Regular Visitor

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

Accepted Solutions
Community Support Team
Community Support Team

Re: Dynamic Columns

hi, @danimelv 

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.
1 REPLY 1
Community Support Team
Community Support Team

Re: Dynamic Columns

hi, @danimelv 

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
GregDeckler

How to Get Your Question Answered Quickly

Power BI Super User, Greg Deckler, explains

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Users Online
Currently online: 50 members 1,078 guests
Please welcome our newest community members: