Forum Discussion
Amit92
4 months agoRegular Visitor
Dynamic Rank Calculation
Hi Team I have a model where i have Dim Market, Dim Brand and Fact Sales. Market ID of Dim Market is connected to Market ID of Fact Sales Brand ID of Dim Brand is connected to Brand ID of Fact S...
- 4 months ago
Please try the measure below:
Kingfisher Top 5 Markets = COUNTROWS ( FILTER ( VALUES ( 'Dim Market'[MarketID] ), VAR _KingfisherSales = CALCULATE ( [Sales], 'Dim Brand'[Brand] = "Kingfisher" ) VAR _Rank = RANKX ( ALLSELECTED ( 'Dim Brand'[Brand] ), CALCULATE ( [Sales] ), _KingfisherSales, DESC, Dense ) RETURN _Rank <= 5 ) )
cengizhanarslan
4 months agoSuper User
Please try the measure below:
Kingfisher Top 5 Markets =
COUNTROWS (
FILTER (
VALUES ( 'Dim Market'[MarketID] ),
VAR _KingfisherSales =
CALCULATE (
[Sales],
'Dim Brand'[Brand] = "Kingfisher"
)
VAR _Rank =
RANKX (
ALLSELECTED ( 'Dim Brand'[Brand] ),
CALCULATE ( [Sales] ),
_KingfisherSales,
DESC,
Dense
)
RETURN
_Rank <= 5
)
)