Forum Discussion
admin_xlsior
Post Prodigy
5 years agoCalculated column for group from other table
Hi guys, How is the DAX looks like if I want to add calculated column for grouping my data based on grouping table ? So I have this group table and my transactions : Thanks,
- 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.
Anonymous
5 years agoNot applicable
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.