cancel
Showing results for 
Search instead for 
Did you mean: 
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 II
Resolver II

Hi @Anonymous ,

Try selectedvalue funtion as below.

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

 

Thank you.

 

View solution in original post

4 REPLIES 4
AUDISU
Resolver II
Resolver II

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



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors