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.
Here is the measure for Dealer ranking number 2 test:
Dealer Ranking Number 2 test =
var _rank = IF( [Ranking Size (Vol)] = blank(), BLANK(), RANKX(ALL('Dealer Ranking'[test 2],'Dealer Ranking'[test]),[Ranking Size (Vol)],,DESC,Dense))
VAR _tab =
FILTER (
ADDCOLUMNS (
ALLSELECTED( 'Dealer Ranking'[test],'Dealer Ranking'[test 2] ),
"@rank", [Dealer Ranking 3]
),
[test 2] = "Barclays"
)
VAR _rankbarclays =
CALCULATE( MAXX ( _tab, [@rank] ),REMOVEFILTERS('Dealer Ranking'[Glimpse_buy_side]))
RETURN
_rankbarclays
Other measures used:
Ranking Size (Vol) =
VAR _volumeall =
CALCULATE(
[Ranking Size],
FILTER(
'Dealer Ranking',
'Dealer Ranking'[Type] = "Vol. (MM)"
)
)
VAR _volumeeur =
CALCULATE(
[Ranking Size (EUR)],
FILTER(
'Dealer Ranking',
'Dealer Ranking'[Type] = "Vol. (MM)"
)
)
RETURN
IF(
ISFILTERED('Dealer Ranking'[Currency]),
_volumeall,
_volumeeur
)
Dealer Ranking 3 = IF( [Ranking Size (Vol)] = blank(), BLANK(), RANKX(ALL('Dealer Ranking'[test 2],'Dealer Ranking'[test]),[Ranking Size (Vol)],,DESC,Dense))
Solved! Go to Solution.
I was able to resolve it!
VAR _rankbarclays =
CALCULATE (
MAXX (
FILTER (
ADDCOLUMNS (
ALL('Dealer Ranking'[Counter Party], 'Dealer Ranking'[Counter Party Blanks]), // Ignore all slicers/filters on Counter Party
"@rank", [Dealer Ranking Number 2 test]
),
[Counter Party] = "Barclays"
),
[@rank]
),
REMOVEFILTERS('Dealer Ranking'[Glimpse_buy_side]) // Explicitly removing filters on Glimpse_buy_side
)
RETURN
_rankbarclays
ALLSELECTED also can be used if you want to apply selected filter contexts.
https://radacad.com/power-bi-dax-all-vs-allselected
Your post need to be updated with sample data, and expected output. Hard to understand from code.
Hello @sevenhills i have added a link in the original post where I have share the sample file.
I am able to see and download your 2 files - excel and pbix.
I assume that you want the measure to show the exact values irrespective of client selected for Barclays.
first part to get the volume is easy and working! slight modification of your volume metric used in the visual.
1. Measure Volume all clients =
IF ( IsBlank([Client size Volume]), BLANK(),
CALCULATE( [Client size Volume], 'Dealer Ranking'[Counter Party] = "Barclays", REMOVEFILTERS('Dealer Ranking'[Glimpse_buy_side]))
)
When it comes to ranking, for some reason it is not working!
I was able to resolve it!
VAR _rankbarclays =
CALCULATE (
MAXX (
FILTER (
ADDCOLUMNS (
ALL('Dealer Ranking'[Counter Party], 'Dealer Ranking'[Counter Party Blanks]), // Ignore all slicers/filters on Counter Party
"@rank", [Dealer Ranking Number 2 test]
),
[Counter Party] = "Barclays"
),
[@rank]
),
REMOVEFILTERS('Dealer Ranking'[Glimpse_buy_side]) // Explicitly removing filters on Glimpse_buy_side
)
RETURN
_rankbarclays
Glad to hear that it is resolved.
I have used the ALL function but it seem to not work
Dealer Ranking Number 2 test =
var _rank = IF( [Ranking Size (Vol)] = blank(), BLANK(), RANKX(ALL('Dealer Ranking'[test 2],'Dealer Ranking'[test]),[Ranking Size (Vol)],,DESC,Dense))
VAR _tab =
FILTER (
ADDCOLUMNS (
ALLSELECTED( 'Dealer Ranking'[test],'Dealer Ranking'[test 2] ),
"@rank", [Dealer Ranking 3]
),
[test 2] = "Barclays"
)
VAR _rankbarclays =
CALCULATE( MAXX ( _tab, [@rank] ),REMOVEFILTERS('Dealer Ranking'[Glimpse_buy_side]))
RETURN
Calculate (_rankbarclays, ALL('Dealer Ranking'))
@ViralPatel212 In _tab you are using ALLSELECTED not ALL. It's almost impossible to be specific here without sample data to recreate.
Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
@I have posted a sample file in the original post. But you can download it from here
@ViralPatel212 You can get your 2 base SUM measures to ignore client by doing this:
@ViralPatel212 Use ALL to override filter context.
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 |
---|---|
99 | |
98 | |
79 | |
74 | |
66 |
User | Count |
---|---|
136 | |
109 | |
104 | |
82 | |
73 |