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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AlexanderRbt
Helper I
Helper I

DATESINPERIOD: table of multiple was supplied where a single value was expected (But it wasn't...)

Hello,

 

I am trying to get this function to work:

 

period = DATESINPERIOD('Calendar'[Date], MAX(engagement[updated_at]), 3, DAY)

 

 

The first argument is a date table that I created using this function: 

 

Calendar = CALENDAR(DATE(2018,1,1),DATE(2022,12,31))

 

 

The second is from my data, containing many dates with a time stamp. When I evaluate MAX(engagement(updated_at) I get exactly one value with a timestamp).  Arguments #3 and #4 are number of intervals, and the interval.

 

I am fairly certain, that I am not passing a table into the function, however, PBI tells me this: "A table of multiple values was supplied where a single value was expected."

 

I kindly ask for advice what I am doing wrong here and how I can pass a single value into this function.

 

thx

Alexander

 

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@AlexanderRbt in your example datesinperiod is returning a table, it is returning 3 rows of data based on max date, and you cannot return a table in a measure, it has to be a scalar value so that error does make sense.

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
parry2k
Super User
Super User

@AlexanderRbt sorry missed not, yes only scalar value not a table. Will fix the reply to avoiding confusion. 🙂

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@AlexanderRbt in your example datesinperiod is returning a table, it is returning 3 rows of data based on max date, and you cannot return a table in a measure, it has to be a scalar value so that error does make sense.

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Dear @parry2k 

 

Thank you for taking the time to respond to me. Do I understand correctly that a measure cannot contain a table, but must contain a scalar. Your sentence was maybe missing a 'not'?

 

That would make sense then. Your help is very much appreciated.

 

Thx

Alexander

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.