Forum Discussion

Bakhtawar's avatar
Bakhtawar
Post Patron
6 years ago
Solved

dax example

i want examples of these points ..    Any DAX function always refers to a complete column/field or a table. It will never refer to individual values. If you want to use the functions on separate v...
  • Greg_Deckler's avatar
    6 years ago

    So, an example of the first one, to get to an individual value of a cell you could do something like this:

     

    Measure = MAXX(FILTER('Table',[Column] = "Something"),[Value])

     

    This would filter the table "Table" to only the rows where "Column" equals the value "Something" and then return the maximum value in the Value column from that subset. Note, there are literally tens of thousands if not hundreds of thousands of examples that could be provided for this because it is how DAX works. It is a core concept and I include it in my book in the first chapter "Thinking DAX".

     

    Correct, this would be a calculated column like:

    New Column = [Column1] + [Column2]

     

    Each row would take the value in Column1 and Column2 for that row and add them together into the new column, "New Column".

     

    Or, in a measure, you can use ADDCOLUMNS and it's the same sort of thing.

     

     

     

     

  • v-eachen-msft's avatar
    v-eachen-msft
    6 years ago

    Hi Bakhtawar ,

     

    Here is the test data.

    Then I created a measure:

    Measure = 
    SUM('Table'[Column3])

    Now you could do see the different results with column1 and column2.

    The measure will show different result depends on your context.