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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

two slicers are effecting the results in the card

Suppose you have category and subcategory slicers, you can select all and multi-select

and we have a ranking measure that let's say using the measure (total sales) giving me the rank of category.

I have measure for category rank : 

VAR CatRanking = IF(HASONEVALUE('Table'[CatName]),
      RANKX ( ALL('Table'[CatName] , 'Table'[CatName]) , [Total Sales] )
)
VAR Result = IF(ISBLANK(CatRanking ) = TRUE, "N/A", CatRanking )
RETURN Result


so, this shows N/A when category and subcategory slicers are all selected.

I can select one category and I get the category rank, good (Y)
When I unselect all categories and select a subcategory It returns 1 all the time, but I don't want to show anything
because this is for category rank 

what should I do ?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thank you but I assume you replied the same response for each of my 2 different questions. 

I found the solution for this problem, it was easy I just didn't think about it... 

when you use interactions like when you select category slicer don't affect it subcategory and vice-versa

 

it works now.

 

thanks

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you but I assume you replied the same response for each of my 2 different questions. 

I found the solution for this problem, it was easy I just didn't think about it... 

when you use interactions like when you select category slicer don't affect it subcategory and vice-versa

 

it works now.

 

thanks

amitchandak
Super User
Super User

@Anonymous , if you create a rank on a category and add a subcategory column in the visual. Then rank will happen for category inside sub-category

 

Your options are

 

RANKX (
ALL('Table'[CategoryName], 'Table'[SubCategoryName] ),
[total sales] , , DESC
)

 

or

 

RANKX (
filter(ALL('Table'[CategoryName], 'Table'[SubCategoryName] ),'Table'[CategoryName] = max('Table'[CategoryName]) ),
[total sales] , , DESC
)

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.