Forum Discussion

dadorsey's avatar
dadorsey
Frequent Visitor
7 years ago
Solved

Calculate a minimum value across multiple rows based on multiple fields

Hi, I'm new to Power BI and struggling to figure out how to calculate a column.   My data has rows of unique transactions representing different problem transactions identified on an account. Each...
  • d_gosbell's avatar
    7 years ago

    You should be able to use a calculation like the following:

    Measure = 
    var _table = CALCULATETABLE(
    Table1,
    ALL(Table1),
    VALUES(Table1[Problem Type]),
    VALUES(Table1[Account]),
    Table1[Monthly Running Total] >= 1000) RETURN MINX(_table, Table1[Transaction Year and Month])


    Firstly I'm creating the _table varialbe using the ALL function to remove all filters from the table, then I add back just the Account and Problem Type filters as well as a filter for where the running total is >= 1000

     

    Then I using MINX to find the minimum month from this variable