Forum Discussion
ViralPatel212
Resolver I
2 years agoRanking Error - showing 1
Wondering if you could help. Second post but getting no help? I am trying to create a simple summarized table where it shows where Barclays sits for each category. in my main table the rank...
- 2 years ago
Was able to resolve this:
Measure: var _rank = RANKX(ALL('Dealer Ranking'[Counter Party]),[Ranking Size (Vol)],,DESC) VAR _tab = FILTER ( ADDCOLUMNS ( ALL( 'Dealer Ranking'[Counter Party] ), "@rank", [Dealer Ranking Number 2 test] ), [Counter Party] = "Barclays" ) VAR _rankbarclays = MAXX ( _tab, [@rank] ) RETURN _rankbarclays
Anonymous
2 years agoNot applicable
I've complete the logical and lmitation of the Dax, and what you should do is to make the two tables' filter the same, different filter can give the different outcomes of the measure, here for your reference:
Row Context and Filter Context in DAX - SQLBI
Here's the measure:
Measure =
VAR _currentCTP =
SELECTEDVALUE( 'Sheet1 (2)'[Counter Party] )
VAR _currentBuySide =
SELECTEDVALUE( 'Sheet1 (2)'[buy_side] )
VAR _currentCurrency =
MAX ( 'Sheet1 (2)'[Currency] )
RETURN
IF (
ISFILTERED ( 'Sheet1 (2)'[Currency] ),
CALCULATE (
SUM ( 'Sheet1 (2)'[Size] ),
FILTER (
ALL ( 'Sheet1 (2)' ),
'Sheet1 (2)'[Counter Party] = _currentCTP
&& 'Sheet1 (2)'[buy_side] = _currentBuySide
&& 'Sheet1 (2)'[Currency] = _currentCurrency
)
),
CALCULATE (
SUM ( 'Sheet1 (2)'[Size] ),
FILTER (
ALL ( 'Sheet1 (2)' ),
'Sheet1 (2)'[Counter Party] = _currentCTP
&& 'Sheet1 (2)'[buy_side] = _currentBuySide
)
)
)
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ViralPatel212
Resolver I
2 years agoWas able to resolve this:
Measure:
var _rank = RANKX(ALL('Dealer Ranking'[Counter Party]),[Ranking Size (Vol)],,DESC)
VAR _tab =
FILTER (
ADDCOLUMNS (
ALL( 'Dealer Ranking'[Counter Party] ),
"@rank", [Dealer Ranking Number 2 test]
),
[Counter Party] = "Barclays"
)
VAR _rankbarclays =
MAXX ( _tab, [@rank] )
RETURN
_rankbarclays