Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello All, Why I can not create the YearMonth column in the linked file through the following DAX :
Date = FORMAT(DATE('Table'[YERR],'Table'[Month],1),"MM-YYYY")How I can create it?
Regards
https://drive.google.com/file/d/10bitgpHEhLOifBtmQVVOJThQhfjDH_Wb/view?usp=sharing
Solved! Go to Solution.
You will need to use following
= FORMAT(DATE(YEAR('Calendar'[Year]),'Calendar'[Month Number],1),"MM-YYYY")In your YEAR column, you have used STARTOFYEAR which gives a date. But in DATE, it needs a number for YEAR. YEAR('Calendar'[Year]) provides that year number.
Second problem was that you were using month name as second argument for Date whereas it needed a number 1-12 which should have been provided through 'Calendar'[Month Number].
Looks like you have misspelled Year as YERR that is why you must be getting error.
Since, your pbix file refers to a csv file, hence data is not visible to me. But you can always refer to date field itself. i.e. even following would work
=FORMAT('Table'[Date],"MM-YYYY")
Use this
Year Month = FORMAT('Calendar'[Date],"MM-YYYY")Where is the problem with the following, please ?
You will need to use following
= FORMAT(DATE(YEAR('Calendar'[Year]),'Calendar'[Month Number],1),"MM-YYYY")In your YEAR column, you have used STARTOFYEAR which gives a date. But in DATE, it needs a number for YEAR. YEAR('Calendar'[Year]) provides that year number.
Second problem was that you were using month name as second argument for Date whereas it needed a number 1-12 which should have been provided through 'Calendar'[Month Number].
Try:
MonthYear = FORMAT(Table[Month], "00") & "-" & Table[Year]
Proud to be a Super User!
Paul on Linkedin.
Where is the problem with the following, please?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 45 | |
| 44 | |
| 20 | |
| 19 |
| User | Count |
|---|---|
| 73 | |
| 71 | |
| 34 | |
| 33 | |
| 31 |