cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper IV

## DAX error : A single value for column 'Date' in table 'Date' cannot be determined.

I am new to DAX and trying learn it. So I am essentially looking for an explanation as to what is causing the error.

Following formula works fine

``````AverageX = Averagex(
VALUES('Date'[Date]
)
,Fact_Hours[SUM Hours]
)``````

However, if I remove the VALUES function, I end up with an error I mentioned in the title of this question

``````AverageX = Averagex(
'Date'[Date]
)
,Fact_Hours[SUM Hours]
)``````

Date column in Date table has unique values already. Why is VALUES function needed?

Also, for second argument to AVERAGEX, Measure works. But if I try to put a column that is already a part of model, it would not. Why would that be?

2 REPLIES 2
Super User

Iteration functions requires a table as first argument. VALUES is a function that creats a table contains the unique values in a column. You cannot refer the column directly.
Iteration functions creat a filter context over the tablw under iteration. Only the columns that belongs to this table can be refrenced directly. Columns from related tables in the "one" side of the relationship can be referenced using RELATED function. The "many" side related table can be referenced using RELATEDTABLE functions which bring a set of rows from the "many" side table which are realted to the current row on the iteration. In this case an aggregation must be provided in order to evaluate any column from this related table.
on the other hand CALCULATE function can be used to perform context transition in irder to evaluate columns from rekated tables. In this case aggregation shall be provided. Remember that any refrenced measure is automatically wrapped with CALCULATE.
please let if you still have any doubts

Super User

@tvaishnav Because you have an errant paren ). The second formula should be:

``````AverageX = Averagex(
'Date'[Date]
,Fact_Hours[SUM Hours]
)``````

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors