How to reference a column in a Calculation Group?

Hi all, I’m wanting to use a line chart with 2 calculation groups; one to change out the y-axis (Metric 2),and one to change out the x-axis (Metric 1). The problem is that I can’t use a measure in the x-axis, I’d have to use either a column or calculated column. I want to be able to use a line chart and then switch out the x-axis to view measures on a YTD and MTD time horizon. Any ideas on how i’d be able to do this?

YTD Dax

CALCULATE(
    [SelectMe],
    FILTER(
        ALLSELECTED( 'ARS PBI_Calendar' ),
        'ARS PBI_Calendar'[CalendarDate]
            <= MAX( 'ARS PBI_Calendar'[CalendarDate] )
    )
)

SelectMe Dax

SELECTEDMEASURE()

@Everett You should use Fields Parameter for this.

Thanks for the recommendation @AntrikshSharma.

I’m having issue trying to set this up though. I was thinking of trying to combine a calculation group with the field parameter.

I was thinking I could pass whatever measure is selected in the calculation group (Metric 2) to the field parameter (Parameter). The only field I have in Parameter is the following DAX:

CALCULATE(
    ISSELECTEDMEASURE([Metric 2 Measure]),
    FILTER(
        ALLSELECTED( 'ARS PBI_Calendar' ),
        'ARS PBI_Calendar'[CalendarDate]
            <= MAX( 'ARS PBI_Calendar'[CalendarDate] )
    )
)

Metric 2 Measure = 0

What would be a way to set this up?

@Everett I think that’s not possible and I would not recommend but still, you can explore the below article and let me know if that works for you. Thanks

Thanks for the info @MohammedHuzefaBagwan

Yeah, idk if what I’m trying to do is possible. I guess what I’m asking for is a dynamic dimension for the x-axis. At first, I thought I could pass the selected measure’s value through my YTD measure, but since you can’t put a measure in the x-axis it won’t even matter.

UPDATE/SOLUTION:

Thanks to @AntrikshSharma for the reccomendation.

I ended up using a calculated group for the metrics/measures and used a field parameter for the x-axis/time series and it works perfectly.

Also, this demo really helped me with the calculation group and formatting everything.

1 Like