Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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. I would like to create a variable that contains all 1-13 values. I thought I could use this as my variable:
Solved! Go to Solution.
Hi @bcastro19 ,
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.
Hi @bcastro19 ,
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.
Hi @v-eqin-msft this is exactly what I was looking for, thank you so much for your help!
@bcastro19 , If you looking to use slicer values then you can not do that in a new column
to you have 13 static columns
1= CALCULATE('2021_Data'[2021AllSales],FILTER('2021_Data','2021_Data'[Category Number]=1) )
or
you can measures
CALCULATE(sum('2021_Data'[2021AllSales]) ,FILTER('2021_Data','2021_Data'[Category Number]=1)
for measure you can use field parameters or calculation group to select
Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
104 | |
77 | |
68 | |
61 |
User | Count |
---|---|
148 | |
107 | |
106 | |
82 | |
70 |