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.
I have a table with the columns "Value", "Analyte", "Color", "AnalyteType" and "DateEnter". I created a calculated column that averages by all those groups and takes only the last 12 months of data. I would like to move this to a measure though, so I can change which data is used on the fly.
Value | Analyte | Color | AnalyteType | DateEnter |
5.44 | Balloon | Blue | Lab | 2022/05/04 |
62.5 | Car | Red | Lab | 2022/03/11 |
11.5 | Car | Purple | Outside | 2022/02/08 |
78.1 | Chair | Blue | Indoor | 2022/04/22 |
Here is the calculated column that works:
Column1 = calculate(average(Main[Value]),filter(Main,Main[Analyte]=EARLIER(Main[Analyte])),filter(Main,Main[Color]=EARLIER(Main[Color])),filter(Main,Main[AnalyteType]="Lab"),filter(Main,Main[DateEnter]>today()-365))
Here is the measure I tried:
Solved! Go to Solution.
@neuro_fun , Try like
calculate(average(Main[Final]),filter(allselected(Main),Main[Analyte]=Max(Main[Analyte]) && Main[Color]=Max (Main[Color]) && Main[AnalyteType]="Lab"))
@neuro_fun , Try like
calculate(average(Main[Final]),filter(allselected(Main),Main[Analyte]=Max(Main[Analyte]) && Main[Color]=Max (Main[Color]) && Main[AnalyteType]="Lab"))
That worked great. Why use the "Max" instead of "Earlier"?
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 |
---|---|
105 | |
94 | |
75 | |
63 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |