Forum Discussion

Fantmas's avatar
Fantmas
Helper III
3 years ago

Column header in matrix visual apply context filter only

Hi All,

 

I am trying to create at matrix staarting from Dec Previous Month to Dec of current Month,

I have created a DAX formulas to do so but The matrix only show me the current year,

 

Evolution = 

var DEC_PY = SWITCH(
                        True(),
                            Not( ISBLANK( ( SELECTEDVALUE(DimDate[Year]) ) ) ),
                            Date(SELECTEDVALUE(DimDate[Year])-1,12,31), Date(YEAR(MAX(DimDate[Year]))-1,12,31))

VAR CUR_Y = SWITCH(
                        True(),
                            Not( ISBLANK( ( SELECTEDVALUE(DimDate[Year]) ) ) ),
                            LASTDATE(DimDate[Period]),LASTDATE(DimDate[Period]))

RETURN

CALCULATE(
    SUM('Fact FTE'[Actual Work FTE]),
    filter(all(DimDate), DimDate[Date] >=
    DEC_PY ))

 

 
but in the Matrix I have the following display without the month of December from previous Month and the only way I can have it, it is by doing a relative date filter :

Without date filter :

 


With the relative filter :

 

If you can help me to know where is the issue,

thank you for your support


2 Replies

  • VijayP's avatar
    VijayP
    Community Champion

    Fantmas 

    Try using ALLSELECTED , All is not considering external slicer if at you are using an external filter or slicer

  • Hi Vijay,

    I tried with all selected but it does not seems to work, I get the same result :


    It still missing Dec 21 beofre January

    Regards