Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

DAX code does not take the filter in the code

Hi Guys,

 

I have the following problem. Below you see mine DAX code and I get the correct result when I filter on the left visual to 0-1 maand indicator to 1. But in the right visual I dont have this measure so that is why I putted this measure in the DAX code as filter. Unfortunatelly I dont get the same result as left visual. I tried many many Code like SUMX but not solution.

 

Korte funding 0-1 mnd = 

Var REPO = calculate( sum( FACT_SCHEDULE[amt_principal_adjustment_eur]), Portfolio[int_ifrs_product] = 207)
Var DEPO = calculate( sum( FACT_SCHEDULE[amt_principal_adjustment_eur]), Portfolio[int_ifrs_product] = 202)
Var CP =  calculate( sum( FACT_SCHEDULE[amt_principal_adjustment_eur]), Portfolio[int_ifrs_product] = 205, Portfolio[txt_paper] = "CP")
VAR A = [0-1 maand indicator]
Return CALCULATE((REPO + DEPO + CP), FILTER(Trade, [0-1 maand indicator] = 1))

 

 

 

5 Replies

  • Anonymous , if this is a measure [0-1 maand indicator]

    you have to use filter using visual group by 

     

    like

    Sumx(filter(values(Trade[Column]) , [0-1 maand indicator] = 1), CALCULATE((REPO + DEPO + CP)))

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi amitchandak ,

       

      I tried your code but I am getting very different result. see below

       

       

  • v-luwang-msft's avatar
    v-luwang-msft
    Community Support

    Hi Anonymous ,

    Could you pls share your pbix file ,and remember to remove confidential data.

     

    Best Regards

    Lucien

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-luwang-msft ,

       

      Unfortunately not because I am using SSAS so direct query connection. Which Information do you that I can provide you?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Please can someone help me with?