Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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"?