sql server - SQL analytical function to DAX -


although might sound want add window function powerpivot table, i'm not... want exclude records based on windowing function.

i have such query similar (sql server):

select  line_number,          suite_name,          group_name,          revision,          status  (     select  line_number,              suite_name,              group_name,              revision,              status,              row_number() on (partition line_number, suite_name, group_name order revision desc) r     tablea      ) t t.r = 1 

this query returns highest revision's row per line_number, suite_name, , group_name.

i want same, dax in excel power pivot.

the result count of line numbers, selected (slicers) suite , group.

the goal select rows tabular data model, , then, using similar functionality, filter records , keep latest revision per applied slicers.

i tried far: calculate, filter, topn, rankx, generate. none of them helped me dynamically "exclude" rows calculation.

can suggest approach?

thanks!

a suggestion use calculated column find max revision value, using earlier function. not work if want have dynamic filter on range of revisions.

calc_column01:=calculate(max(mytable[revision]),filter(mytable,mytable[line_number]=earlier(mytable[line_number])&&mytable[suite_name]=earlier(mytable[suite_name])))

then add measure01:=calculate(values(mytable[status]),filter(allselected(mytable),mytable[revision]=max(mytable[calc_column01])))

powerpivot window

sampledate , result in powerpivot:

result


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -