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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

If Statement Only lets me use Measures in a new table or column

Hey, I have been trying to create a new column in my table using an IF statement, but when I try to reference a column in my date table, it only shows autofill for measures in that table and not columns. When I try typing in the column name Date, It says it cannot find it. When I try to create the calculated column anyways, it gives me this error: A single value for column 'Date' in table 'Calander' 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. I have made sure I am not creating a measure, I have never had this problem before. I attached a screenshot of what my date table looks like too. Any help?

kolli_0-1659110684672.png

 

1 ACCEPTED SOLUTION
AUDISU
Resolver III
Resolver III

Hi @Anonymous ,

Try selectedvalue funtion as below.

IF (SelectedValue(TableName[ColumnName]) = "Condition")

 

Thank you.

 

View solution in original post

4 REPLIES 4
AUDISU
Resolver III
Resolver III

Hi @Anonymous ,

Try selectedvalue funtion as below.

IF (SelectedValue(TableName[ColumnName]) = "Condition")

 

Thank you.

 

What does selected value mean for this?

AlexisOlson
Super User
Super User

I'm guessing you're trying to create a new calculated column in a table other than 'Calander'? In this case, the error is exactly as described. It doesn't know which Date value you're trying to reference (since there isn't any row context).

 

What is your IF column attempting to do?

amitchandak
Super User
Super User

@Anonymous , There might be another date column in the model, better to use 'Date'[Date].

 

The measure will take measure and aggregated columns

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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