Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
souvik900766
Helper IV
Helper IV

Top N issue/Bug

Hi !

Facing an issue in TOP N...
I am showing CTG with colur and top and bottom together with a what if slicer. The problem is the negative is showing green sometimes and the positive is show red !
Refer the pic:-

ctg.PNG


the measures I have used:-
1)

Top N for CTG Brand = GENERATESERIES(0, 5000, 1)
2)
Top N for CTG Brand Value = SELECTEDVALUE('Top N for CTG Brand'[Top N for CTG Brand])
3)
Top/Bottom Nrank for CTG Brand =
Var selectedtop = SELECTEDVALUE('Top N for CTG Brand'[Top N for CTG Brand])
Var rankasc = RANKX(ALLSELECTED('Brand Name'[Brnd-nom]),CALCULATE([CTG Brand]),,ASC)
Var rankdesc = RANKX(ALLSELECTED('Brand Name'[Brnd-nom]),CALCULATE([CTG Brand]),,DESC)

return
IF(rankasc<=selectedtop || rankdesc<=selectedtop,[CTG Brand])
4)
Color CTG Brand = IF(SELECTEDVALUE('Brand Name'[Brnd-nom]) in TOPN([Top N for CTG Brand Value],ALLSELECTED('Brand Name'[Brnd-nom]),[CTG Brand],DESC),"#008000","#FF0000")
Then in the filter pane I have used measure 3 as is not blank.

Any help will be appreciated !
Thanks in advance.
1 REPLY 1
daxer-almighty
Solution Sage
Solution Sage

@souvik900766 

 

You have to give us a file that demonstrates the issue. Otherwise... it'll be very hard to come up with an explanation and a remedy.

 

Please store an example file somewhere on a shared drive like Google Drive or OneDrive and paste a link to the file in here.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.