cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Periksson Frequent Visitor
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

Accepted Solutions
Highlighted
tarunsingla Established Member
Established Member

Re: SELECTEDVALUE ALTERNATERESULT

Try this:

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

View solution in original post

1 REPLY 1
Highlighted
tarunsingla Established Member
Established Member

Re: SELECTEDVALUE ALTERNATERESULT

Try this:

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

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 6 members 915 guests
Please welcome our newest community members: