Forum Discussion
afaro
2 years agoHelper III
Creating dynamic table with SELECTEDVALUE?
Is it possible to create dynamic tables this way? I have written dax for creating tablewhich works perfectly fine when I manually provide the filters (which then makes it a static table) but when I...
- Anonymous2 years ago
Hi afaro ,
I created a sample pbix file(see the attachment), please check if that is what you want.
Added products = VAR _month = SELECTEDVALUE ( 'Date'[Month] ) VAR table1 = CALCULATETABLE ( VALUES ( 'Data'[Product] ), FILTER ( 'Data', 'Data'[Month] = _month ) ) VAR table2 = CALCULATETABLE ( VALUES ( 'Data'[Product] ), FILTER ( 'Data', 'Data'[Month] = _month - 1 ) ) VAR _tab = EXCEPT ( table1, table2 ) RETURN CONCATENATEX ( _tab, [Product], "," )Best Regards
lbendlin
2 years agoSuper User
SELECTEDVALUE is meaningless without a filter context. You can create "dynamic tables" but only as an intermediate step in a measure calculation.