Forum Discussion

sajjadkhan25's avatar
sajjadkhan25
Helper I
4 years ago

Need to add all function inside filter condition

Hi Team,@amitchandak,@Samarth_18,@parry2k


need to make this work,


COGS =
CALCULATE(
SUM('vwConsolidated2C'[COGS]),all(Ac_T1[FY]),all('Type'),USERELATIONSHIP(vwConsolidated2C[Type_new],Type2[Type]),
FILTER(DATESYTD(vwConsolidated2C[Fiscal Date]),MAX(vwConsolidated2C[fiscal_Mon_year])=SELECTEDVALUE(Ac_T2[FY]))
)

 

if i use this all function is not working how can i include in filter condition.
please help me out... 


3 Replies

  • sajjadkhan25 , with help from Date table , joined with vwConsolidated2C[Fiscal Date]

     

    COGS =
    var _Mes = CALCULATE(SUM('vwConsolidated2C'[COGS]),USERELATIONSHIP(vwConsolidated2C[Type_new],Type2[Type]))
    return
    CALCULATE(_Mes,DATESYTD('Date'[Date]))

    or

     

    COGS =
    var _Mes = CALCULATE(SUM('vwConsolidated2C'[COGS]),USERELATIONSHIP(vwConsolidated2C[Type_new],Type2[Type]))
    return
    CALCULATE(_Mes,,DATESYTD('Date'[Date]),all('Type')) // not sure on the need of all(Ac_T1[FY]), but you can add it here

    CALCULATE(_Mes,,DATESYTD('Date'[Date]),all('Type'),all(Ac_T1[FY]))

     

     

    If this does not help
    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

  • Hi amitchandak  sir,

    but for DATESYTD i have maximum limit from slicer even dax should include that condition till where running total should happen