Forum Discussion

Scott-RSM's avatar
Scott-RSM
New Member
2 years ago
Solved

Dynamic Calculated Table and Get Min & Max Values

Hi There,    I have been struggling to get the max and mins from a calculated table through a measure.   I am looking to group an imported table by a unique key and then get the max and min value...
  • Scott-RSM's avatar
    2 years ago

    I was able to work out my problem - was more to do with where I was creating the new table / column and how my visuals would be filtering. Below is the DAX which resolved it:

     

    var _group = ADDCOLUMNS(ALLSELECTED('Billing Group Details'), "Billing Group Natural Profit", CALCULATE(SUM('WIP Entries'[Natural Profit]), FILTER(ALLSELECTED('WIP Entries'),'WIP Entries'[zLinkKey] = FIRSTNONBLANK('Billing Group Details'[zLinkKey],TRUE()))))
    var _minX = MINX(_group,[Billing Group Natural Profit])
    var _maxX = MAXX(_group,[Billing Group Natural Profit])