Forum Discussion
Sort Column with Duplicate Values
- 3 years ago
Anonymous So, there are a number of approaches. You could create a table visual with Invoice Number and then put Current Date for Feed and use a default Earliest or Max aggregation. Then you could write measures like:
Open Amount Measure = VAR __Date = MIN('Table'[Current Date For Feed]) VAR __Invoice = MAX('Table'[Invoice Number]) VAR __Table = FILTER('Table',[Current Date For Feed] = __Date && [Invoice Number] = __Invoice) RETURN MAXX(__Table,[Open Amount]) and Original Amount Measure = VAR __Date = MIN('Table'[Current Date For Feed]) VAR __Invoice = MAX('Table'[Invoice Number]) VAR __Table = FILTER('Table',[Current Date For Feed] = __Date && [Invoice Number] = __Invoice) RETURN MAXX(__Table,[Original Amount])You could also create a new DAX calculated table using SUMMARIZE by Invoice Number and FiscalYear with a MIN of your Current Date for Feed and then a kind of similar calculation for ADDCOLUMNS to add in your Open Amount and Original Amount.
In Power Query you could do a Group By by those same two columns with a MIN for your Current Date for Feed and I think you would preserve all rows for your other two columns. I'd have to play with it.
Finally, the "right" way to do it would be to get your database folks to create you a view that summarizes the data the way you want and then your data loads would be much faster (not importing a bunch of useless rows).
Let me know what route you are thinking.
Anonymous So, there are a number of approaches. You could create a table visual with Invoice Number and then put Current Date for Feed and use a default Earliest or Max aggregation. Then you could write measures like:
Open Amount Measure =
VAR __Date = MIN('Table'[Current Date For Feed])
VAR __Invoice = MAX('Table'[Invoice Number])
VAR __Table = FILTER('Table',[Current Date For Feed] = __Date && [Invoice Number] = __Invoice)
RETURN
MAXX(__Table,[Open Amount])
and
Original Amount Measure =
VAR __Date = MIN('Table'[Current Date For Feed])
VAR __Invoice = MAX('Table'[Invoice Number])
VAR __Table = FILTER('Table',[Current Date For Feed] = __Date && [Invoice Number] = __Invoice)
RETURN
MAXX(__Table,[Original Amount])
You could also create a new DAX calculated table using SUMMARIZE by Invoice Number and FiscalYear with a MIN of your Current Date for Feed and then a kind of similar calculation for ADDCOLUMNS to add in your Open Amount and Original Amount.
In Power Query you could do a Group By by those same two columns with a MIN for your Current Date for Feed and I think you would preserve all rows for your other two columns. I'd have to play with it.
Finally, the "right" way to do it would be to get your database folks to create you a view that summarizes the data the way you want and then your data loads would be much faster (not importing a bunch of useless rows).
Let me know what route you are thinking.
- Anonymous3 years agoNot applicable
Greg_Deckler Thanks for your help! I ended up doing the table visual and then manage to do measurement from measurement for other needed visual.