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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ToNo87
Regular Visitor

using the Format on a datetime gives error for not using max, count or sum

Hi,

 

I have the following DAX measure Year-Month-Setup = FORMAT('Setup'[EventTime], "YYYY-MM") the EventTime is in a DateTime Format, I can have multiple entires on a day. I want to make a reference to this by creating a new measure that just gives me the YYYY and MM so I can add in the one of my graphs to split the axis.

 

This is the error I am getting:

A single value for column 'EventTime' in table 'Setup' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

1 ACCEPTED SOLUTION

Yes, that I can understand, however doing min or max will only give me one value, I can have multiple months of data?

 

EDIT: I changed it to a column and it solved the problem.

View solution in original post

2 REPLIES 2
KHorseman
Community Champion
Community Champion

You're adding this as a measure, which means you have to have some kind of aggregation. FORMAT just formats a single result. You're giving it a column reference, which is not a single result. You'll need to nest something inside that format to get a single result. FORMAT(MIN('Setup'[EventTime]), "YYY-MM") or something like that.





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

Proud to be a Super User!




Yes, that I can understand, however doing min or max will only give me one value, I can have multiple months of data?

 

EDIT: I changed it to a column and it solved the problem.

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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