Forum Discussion
Calculated column for group from other table
- Anonymous5 years ago
Hi admin_xlsior ,
Based on your description, you cannot create calculated columns when you are in Direct Query Mode. Instead, you can create a measure as follows.
Measure =
var x1=DATEDIFF(SELECTEDVALUE('Transaction'[CreateDate]),TODAY(),DAY)
return
MAXX(FILTER(ALL('Age Grouping'),[From]<=x1&&x1<=[To]),[Description])Result:
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
admin_xlsior , Create a new column in transaction table like
new column =
var _diff = datediff([created_date],today(), day) //Add +1 if needed
return
maxx(filter('Age Grouping',_diff >= 'Age Grouping'[from] && 'Age Grouping',_diff <= 'Age Grouping'[to] ), [Description])
refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8
- admin_xlsior5 years ago
Post Prodigy
Hi amitchandak
So sorry, one important thing I forgot here is I'm using Direct Query, so I think MAXX is not supported.
Thanks,
- amitchandak5 years ago
Super User
admin_xlsior , Try measure like
new measure =
var _diff = datediff([created_date],today(), day) //Add +1 if needed
return
maxx(filter('Age Grouping',_diff >= max('Age Grouping'[from]) && 'Age Grouping',_diff <= max('Age Grouping'[to]) ), [Description])