Forum Discussion
Calendar functions
- 8 years ago
You can do both way but with DAX it would be somethig like:
DateOnly = DATE( Year(Table[DateAdded]), Month(Table[DateAdded]), Day(Table[DateAdded[) )
Change the data type to date in modelling tab and then set relationship onthis column with your "master data" date column.
Anonymous I have given those quotes here only they are not available in data source which is SQL. I am using master calendar dates only as you have mentioned but for some reason its not calclating my measures and same measures are working fine with other date formates . Script given by you creates calendar table and not measure right?? .Thanks for your time.
Yes, the script will create a calendar table based upon Power BI, not your SQL Database so it should work.
When looking at your example it seems Power BI is not recognizing the date format. Have you tried using a simple Dax Date function on it to test?
- MadhuReddy8 years agoHelper I
Anonymous Hi, Yes it is not reconizing . No I have not used that function. Could you please guide me.
Thank you
- parry2k8 years agoSuper User
You need to add another column in your data table to for date, you current dateadded column is date and time and the relatedionship with master date is not working because of the time
Add another calculated column for dateadded which is just date and then set relationship on this column with master date table.
- MadhuReddy8 years agoHelper I
parry2k Hi, Do i have to add it in modelling tab or query editor ? What will be the script for calculated column..Could you please guide me. Thank you for your time.