cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Moderator v-yuezhe-msft
Moderator

Re: DateTime.LocalNow to number conversion

Hi @RMDNA,

Do not create the column in Query Editor. Right-Click your table in Report View, then select "New column" and apply my DAX code.
1.PNG


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
RMDNA Senior Member
Senior Member

Re: DateTime.LocalNow to number conversion

@v-yuezhe-msft

 

Sorry - it broke again. Here's your code:

 

Column = IF(Table1[DateColumn]>RELATED(Table2[DateColumn]),1,0)

 

Here's a picture of my "add column" from right-clicking in the standard report view and pasting the DAX, in case I'm doing anything wrong:

 

1.PNG

 

I get the error:

"A single value for column 'StartDateID' in table 'Table One' 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."

 

To reiterate my goal, each entry in "Table One" is unique, and has a whole number "StartDateID" of when the event was run. I've successfully changed localtime into a whole number in Table Two, and I'm attempting to say "only display Events (in table one) where the event date is (greater/less than) the current date (out of table two).

 

Additionally, from what you mentioned earlier: what's the functional difference between doing "add column" in report view and adding a column in Edit Queries?

Moderator v-yuezhe-msft
Moderator

Re: DateTime.LocalNow to number conversion

Hi @RMDNA,

Do you choose "New Measure" or "New column" to apply my DAX? Please ensure that you choose "New column" as highlighted in my screenshot. Also make sure that you have created relationship between the two tables.

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
RMDNA Senior Member
Senior Member

Re: DateTime.LocalNow to number conversion

@v-yuezhe-msft- Yes, I already had the many:1 relationship, and chose "New Column."

Moderator v-yuezhe-msft
Moderator

Re: DateTime.LocalNow to number conversion

Hi @RMDNA,

Could you please share me sample data of your tables?

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.