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'm sharing a pbix file (attached)...
Hello! I have a data set containing number of uses of an item by month for 12 months. I need to be able to pick an item from the slicer and have the table show usage in each month column 1, the average of the 12 months in every row (not rolling) as column 2 (I've done this in a measure calculating the average for the selected item with an ALL function), and the average with the top 3 and bottom three values dropped in column 3. The last part is where I'm getting stuck. Here's my visual so far:
So I'm looking for one more column that would drop the highest and lowest three values from usage and average the remaining 6 for whatever item I have selected, eventually looking something like this if I've picked item 100008:
Any ideas? Thanks!
Solved! Go to Solution.
Mid AVG =
VAR __m = ALLSELECTED( 'Usage Data'[Month] )
VAR __rank = [RANK]
RETURN
IF(
__rank > 3 && __rank <= COUNTROWS( __m ) - 3,
AVERAGEX(
FILTER(
__m,
VAR __r = [RANK]
RETURN
__r > 3
&& __r <= COUNTROWS( __m ) - 3
),
[Total]
)
)
Excel worksheet formula is way powerful to solve such a simple question,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Mid AVG =
VAR __m = ALLSELECTED( 'Usage Data'[Month] )
VAR __rank = [RANK]
RETURN
IF(
__rank > 3 && __rank <= COUNTROWS( __m ) - 3,
AVERAGEX(
FILTER(
__m,
VAR __r = [RANK]
RETURN
__r > 3
&& __r <= COUNTROWS( __m ) - 3
),
[Total]
)
)
Excel worksheet formula is way powerful to solve such a simple question,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
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 |
---|---|
109 | |
96 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |