cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Buzz1126 Regular Visitor
Regular Visitor

SELECTEDVALUE() function not recognized

I'm trying to create a measure that grabs last year's sales so that I can compare them to this year's sales.

 

It is saying that the SELECTEDVALUE() is not recognized.

"The report measure FactSalesOrderDetail[Previous Yr Sales] has a syntax or semantic error at line 4, position 36, reported by Analysis Services: 'Failed to resolve name 'SELECTEDVALUE'.  It is not a valid table or function name.

 

Previous Yr Sales = CALCULATE(
	SUM(FactSalesOrderDetail[InvoiceQuantity]),
	FILTER(ALL(ActualDeliveryDate),
		ActualDeliveryDate[FiscalYear] = SELECTEDVALUE(ActualDeliveryDate[FiscalYear]) - 1 
		)
		)

Has anyone encountered this before?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: SELECTEDVALUE() function not recognized

@Buzz1126 instead of selectedvalue , replace it with min or max function.






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

7 REPLIES 7
Super User IV
Super User IV

Re: SELECTEDVALUE() function not recognized

@Buzz1126 what is your data source? How you are connected?






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Buzz1126 Regular Visitor
Regular Visitor

Re: SELECTEDVALUE() function not recognized

Get Data -> Analysis Services -> type in database

Super User IV
Super User IV

Re: SELECTEDVALUE() function not recognized

@Buzz1126 seems like you are using direct query to connect to Analysis service, read this post to understand what DAX functions are allow/optimized when direct query mode is used.

 

 






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Community Support Team
Community Support Team

Re: SELECTEDVALUE() function not recognized

Hi @Buzz1126 ,

Will you have this issue if you use import mode?

If not, you may could try other aggregated function like MAX or MIN to get the value instead of SELECTEDVALUE().

If you still have the issue when you use import mode, please share some data sample and your formula so that we could have a test on it.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Buzz1126 Regular Visitor
Regular Visitor

Re: SELECTEDVALUE() function not recognized

I'm not able to use import mode as I'm connected to a live data query.  I'd think this should be something that is easily accomplished on our "data cube", but IT doesn't seem to know how to do it.  

 

I'll have to look into min/max functions, i'm not familiar with them.  

 

Thank you all for your responses.

Super User IV
Super User IV

Re: SELECTEDVALUE() function not recognized

@Buzz1126 instead of selectedvalue , replace it with min or max function.






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Buzz1126 Regular Visitor
Regular Visitor

Re: SELECTEDVALUE() function not recognized

Oh! that's simple and it works! thank you

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors