Forum Discussion
Anonymous
4 years agoNot applicable
Assign Column Value to a Variable
Hi, I am trying to create a variable that contains the values in one of my table columns. For example, I have column called Category Number which assigns a text column a number ranging from 1-13...
- Anonymous4 years ago
Hi Anonymous ,
VALUES() function returns a table.
You could add a column or create a measure to get the sum of sales:
Column = CALCULATE(SUM('2021_Data'[Sales]),FILTER('2021_Data',[CAT]=EARLIER('Table'[CAT]))) Measure = CALCULATE(SUM('2021_Data'[Sales]),FILTER('2021_Data',[CAT]=MAX('Table'[CAT])))Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
Hi Anonymous ,
VALUES() function returns a table.
You could add a column or create a measure to get the sum of sales:
Column = CALCULATE(SUM('2021_Data'[Sales]),FILTER('2021_Data',[CAT]=EARLIER('Table'[CAT])))
Measure = CALCULATE(SUM('2021_Data'[Sales]),FILTER('2021_Data',[CAT]=MAX('Table'[CAT])))
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
Hi Anonymous this is exactly what I was looking for, thank you so much for your help!