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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Rabi
Resolver I
Resolver I

Limit Parameter slicer to be applied to a specific measure in Matrix

Hi Everyone,

 

I have a matrix visual with MTD and YTD values for expenses with location and account lines. I need MTD  to be filtered and i want YTD to remain static, to filter the MTD value i have used a parameter and used slicer from it. How can i limit YTD value to not get affected from the slicer. I also have a relation from table A with the parameter table. The measure for YTD value is as below:

YTD = 
VAR n = [EXPENSES]
VAR d = year(today())
RETURN
CALCULATE(
    n,
    ALLEXCEPT('Table A', 'Table A'[Date].[Year]),
    'Table A'[Date].[Year] = d
)

Measure for MTD:

MTD-PARAM = 
CALCULATE(
    [EXPENSES],
    'Table A'[Month NO] = SELECTEDVALUE('Parameter Table'[Month NO]) &&
    YEAR('Table A'[Date]) = YEAR(TODAY())
)

 

Thanks For the help.

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @Rabi 

 

Try this:

YTD = 
VAR CurrentYear = YEAR(TODAY())
RETURN
CALCULATE(
    [EXPENSES],
        REMOVEFILTERS ( 'Parameter Table' ),
        YEAR('Table A'[Date]) = CurrentYear
 
)

 

Or

YTD = 
VAR CurrentYear = YEAR(TODAY())
RETURN
CALCULATE(
    [EXPENSES],
    FILTER(
        ALL('Table A'), 
        YEAR('Table A'[Date]) = CurrentYear
    )
)

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

LinkedIn | Twitter | Blog | YouTube 

 

 

 

View solution in original post

3 REPLIES 3
VahidDM
Super User
Super User

Hi @Rabi 

 

Try this:

YTD = 
VAR CurrentYear = YEAR(TODAY())
RETURN
CALCULATE(
    [EXPENSES],
        REMOVEFILTERS ( 'Parameter Table' ),
        YEAR('Table A'[Date]) = CurrentYear
 
)

 

Or

YTD = 
VAR CurrentYear = YEAR(TODAY())
RETURN
CALCULATE(
    [EXPENSES],
    FILTER(
        ALL('Table A'), 
        YEAR('Table A'[Date]) = CurrentYear
    )
)

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

LinkedIn | Twitter | Blog | YouTube 

 

 

 

Hi @VahidDM , 

 

The first dax worked perfect as the idea was to remove filter from the parameter slicer. Thanks very much, Absolute legend.

 

 

Glad it fixed.

 

Thanks

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.