Forum Discussion
user10001
6 years agoFrequent Visitor
Calculate average for ranks
Hi I am new to powerBI. I am trying to calculate the average revenue in different strata like below (hypothetical data). I have a sales table for each state. I calculates ranks based on the sales, an...
- Anonymous6 years ago
Hi user10001 ,
Yes. Just change the rank measure like this:
rank = VAR _rank = RANKX ( FILTER ( ALL ( Sheet1 ), 'Sheet1'[Date] >= MIN ( DateSlicer[Date] ) && 'Sheet1'[Date] <= MAX ( DateSlicer[Date] ) ), CALCULATE ( MAX ( ( 'Sheet1'[Revenue] ) ) ), , DESC, SKIP ) RETURN IF ( MAX ( 'Sheet1'[Date] ) >= MIN ( DateSlicer[Date] ) && MAX ( 'Sheet1'[Date] ) <= MAX ( DateSlicer[Date] ), _rank, BLANK () )Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
Anonymous
6 years agoNot applicable
Hi user10001 ,
Yes. Just change the rank measure like this:
rank =
VAR _rank =
RANKX (
FILTER (
ALL ( Sheet1 ),
'Sheet1'[Date] >= MIN ( DateSlicer[Date] )
&& 'Sheet1'[Date] <= MAX ( DateSlicer[Date] )
),
CALCULATE ( MAX ( ( 'Sheet1'[Revenue] ) ) ),
,
DESC,
SKIP
)
RETURN
IF (
MAX ( 'Sheet1'[Date] ) >= MIN ( DateSlicer[Date] )
&& MAX ( 'Sheet1'[Date] ) <= MAX ( DateSlicer[Date] ),
_rank,
BLANK ()
)Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
- user100016 years agoFrequent Visitor
Anonymous That is what I was looking for. Thank you!