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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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