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 all,
I have data in PowerBI as shown below in column A,B and C.
I want to create a calculated measure which gives the average value by objective and by month.
For example, if I filter month Feb19 and Mar19 then the [Avg by objective] should show number '2.5' and '5.5' for objective A and B, respectively (As shown in the second table).
Currently, my [Avg by objective] always shows the same value (the average of value by objective) and did not change when I filter the month.
Solved! Go to Solution.
Hi @Anonymous ,
Please refer to the following DAX query:
Avg by objective = VAR selectedvalues = ALLSELECTED ( 'Table'[Month] ) RETURN CALCULATE ( AVERAGE ( 'Table'[Value] ), FILTER ( ALL ( 'Table' ), 'Table'[Objective] = MIN ( 'Table'[Objective] ) && 'Table'[Month] IN selectedvalues ) )
The result will like below:
Best Regards,
Teige
Hi @Anonymous ,
Please refer to the following DAX query:
Avg by objective = VAR selectedvalues = ALLSELECTED ( 'Table'[Month] ) RETURN CALCULATE ( AVERAGE ( 'Table'[Value] ), FILTER ( ALL ( 'Table' ), 'Table'[Objective] = MIN ( 'Table'[Objective] ) && 'Table'[Month] IN selectedvalues ) )
The result will like below:
Best Regards,
Teige
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 |
---|---|
114 | |
100 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |