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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Periksson
Frequent Visitor

SELECTEDVALUE ALTERNATERESULT

I have made a new measure that will give me only selected top N from the list of goods ranging from 5 to 100 e.g.
The ALTERNATERESULT in SELECTEDVALUE is default BLANK() so it shows an empty list of goods. I want it to show the whole list of goods when none N of top N is selected.
This is my measures for reference:

 

Top N Goods = CALCULATE([Profit]; TOPN([Selected N]; wrhsSales; [Profit]; DESC; wrhsSales[Goods]))
Selected N = SELECTEDVALUE('Select Top N'[Select N])

I can type in a really big number that will certainly be outside the list but that is bad programming. Can anyone help?

1 ACCEPTED SOLUTION
tarunsingla
Solution Sage
Solution Sage

Try this:

Selected N = SELECTEDVALUE('Select Top N'[Select N], COUNT(wrhsSales[Goods]))

View solution in original post

1 REPLY 1
tarunsingla
Solution Sage
Solution Sage

Try this:

Selected N = SELECTEDVALUE('Select Top N'[Select N], COUNT(wrhsSales[Goods]))

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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