Forum Discussion
Scott-RSM
2 years agoNew Member
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...
- 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])
Scott-RSM
2 years agoNew Member
I have done some further testing and found out that when I filter directly to the 'WIP Entries' table the above dax works as expected. The problem seems to be when I am filtering another table which has a relationship to the 'WIP Entries' Table it doesn't apply the filter.
Any thoughts on how to work around this?
Thanks
Scott