Forum Discussion
Date Hierarchy for Quick Measure Not Working
Can you show a picture of your date column in the query view like I did? Is it formatted to date? Is it the full date (mm/dd/yyyy)? Dending on the date format, you may have to create a separate "date table" in Power BI and set-up a relationship betwen your date column and the date table, then use the date table in your visuals/reporting.
You can create a date table in Powe BI by going to the "Modeling" tab in the ribbon, selectin "New Table" and pasting this code in. Hope this helps.
Date =
ADDCOLUMNS (
CALENDAR (DATE(2000,1,1), DATE(2025,12,31)),
"Year", YEAR ( [Date] ),
"Monthnumber", FORMAT ( [Date], "MM" ),
"YearMonthnumber", FORMAT ( [Date], "YYYY/MM" ),
"YearMonthShort", FORMAT ( [Date], "YYYY/mmm" ),
"MonthNameShort", FORMAT ( [Date], "mmm" ),
"MonthNameLong", FORMAT ( [Date], "mmmm" ),
"DayOfWeekNumber", WEEKDAY ( [Date] ),
"DayOfWeek", FORMAT ( [Date], "dddd" ),
"DayOfWeekShort", FORMAT ( [Date], "ddd" ),
"Quarter", "Q" & FORMAT ( [Date], "Q" ),
"YearQuarter", FORMAT ( [Date], "YYYY" ) & "/Q" & FORMAT ( [Date], "Q" ))
When you use SSAS you don't have access to the underlying query..
version is correct
- Brysonds7 years ago
Helper III
I am not talking about the SSAS query, I am talking about the query in Power BI. If you are importing data from a data source into Power BI, it automatically creates a query where you can apply ETL.
If you aren't importing the data and instead are doing a live connection, then I am afraid there isn't anything I can help with.
- JCrilly7 years agoFrequent Visitor
Yes, its a live connection
here is the date definition in SSAS tabular