Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

DAX CALCULATE Function with FILTER Statement

Hi, I'm new to Power BI.  Can someone explain to me why using FILTER in the below DAX Calc seems to break out the calc down to row level granularity whereas when it is not used the value is aggregated?  It's like the fields specified in the FILTER statement are controlling the granuarity or level of detail.  I realize FILTER is a table function and maybe I don't understand the signifigance of tables.  Thanks in advance!

 

Expenses = CALCULATE(

    [Transaction Amount],

    FILTER(transactions, transactions[Transaction Type] = "debit"),

    Category[Category] <> "transfer",

    Category[Category] <> "Credit Card Payment"

)

 

Expenses 2 = CALCULATE(

    [Transaction Amount],

    transactions[Transaction Type] = "debit",

    transactions[Description] <> "transfer",

    transactions[Description] <> "Credit Card Payment"

)

 

 

 

 

 

 

 

 

 

 

 

  • Anonymous not sure what your question is? IN 2nd measure you have different columns used for filters. This post explains how DAX works when you give a statement like Table[Column] = "ABC"

     

    Check my latest blog post Compare Budgeted Scenarios vs. Actuals to get a summary of my favourite Power BI feature releases in 2020

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

2 Replies

  • Anonymous not sure what your question is? IN 2nd measure you have different columns used for filters. This post explains how DAX works when you give a statement like Table[Column] = "ABC"

     

    Check my latest blog post Compare Budgeted Scenarios vs. Actuals to get a summary of my favourite Power BI feature releases in 2020

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

    • Anonymous's avatar
      Anonymous
      Not applicable

      That's a very good point!  I've been looking at this way too long!