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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors