Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi, everyone. I'm trying to create a card which shows the name of the manager whose store ranked with most financial losses per month. I've implemented this with a data slicer and a map. The data slicer is segmented by State and Store Name and I wanna see the name of the manager of each store if it is selected in the data slicer too. However, there's a limitation in the Dax Formula I'm using it. That's because the value of financial losses can be negative or positive and whenever I select a store with negative value on the data slicer, my card returns blank value.
I'm using the following measure to show the Top1 manager of the month:
Solved! Go to Solution.
Hi, @Anonymous
Top N does not work with negative numbers.
Please try to replace with function 'SAMPLE' .
Coordenador2 = CALCULATE(FIRSTNONBLANK('ABRIL 22'[COOR ATU],1),SAMPLE(1,'ABRIL 22',[Perda Total],DESC))
You can also create a sort column 'Rank' using ‘RANKX’, then filter data with ‘Rank’=1.
Please refer this related tread.
Best Regards,
Community Support Team _ Eason
Hi:
Do you have a small example file to help understand? You can use ABS[Measure Name]) to give absolute values so it won't matter if positive or negative(if that's what you want).
Generally, this measure should help get top 1 no matter the tme frame you slice on:
If [Perda Total] = the financial loses and you have a separate dim
table for all of your unique financial managers names, e.g. Manager[Mgr Name] as one column in this table.
Top1 mgr = CALCULATE([Perda Total],
TOPN(1, Managers[Mgr Name], DESC)
You should also have a separate Date Table where you can slice on month, year ,etc and the Top1 will show up based on your slections.
I hope this helps!
P.S. An example model is placed below so you can see the relationships which brings all the nalytical power.
Currently, the dashboard is like this. In fact, there are 3 types of job titles related for each store. All three are blank whenever I select a Store with negative value for Total Loss. I don't think ABS() function would solve my problem because a negative value could rank higher than a positive value using this function. I just would like a way to use TOPN or another function considering negative and positive numbers on the ranking.
Hi, @Anonymous
Top N does not work with negative numbers.
Please try to replace with function 'SAMPLE' .
Coordenador2 = CALCULATE(FIRSTNONBLANK('ABRIL 22'[COOR ATU],1),SAMPLE(1,'ABRIL 22',[Perda Total],DESC))
You can also create a sort column 'Rank' using ‘RANKX’, then filter data with ‘Rank’=1.
Please refer this related tread.
Best Regards,
Community Support Team _ Eason
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |