Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a date column of the type 201701, 201702, 21703, i.e. only showing YearMonth.
How do I calculate a new column, based on the above column, also including the last day of each month?
Solved! Go to Solution.
Hi @David_1970,
You may need an extra date table like this:
Dim date = CALENDAR(DATE(2017,1,1),DATE(2017,12,31) )
Then, filter above calendar table. In this filtered table, create a YearMonth column.
Dim Table2 = CALCULATETABLE ( 'Dim date', FILTER ( 'Dim date', 'Dim date'[Date] = CALCULATE ( MAX ( 'Dim date'[Date] ), ALLEXCEPT ( 'Dim date', 'Dim date'[Date].[Year], 'Dim date'[Date].[Month] ) ) ) )
YearMonth = FORMAT ( 'Dim Table2'[Date], "YYYYMM" )
Last day of each month = LOOKUPVALUE ( 'Dim Table2'[Date], 'Dim Table2'[YearMonth], TableName[YearMonth] )
Hi @David_1970,
You may need an extra date table like this:
Dim date = CALENDAR(DATE(2017,1,1),DATE(2017,12,31) )
Then, filter above calendar table. In this filtered table, create a YearMonth column.
Dim Table2 = CALCULATETABLE ( 'Dim date', FILTER ( 'Dim date', 'Dim date'[Date] = CALCULATE ( MAX ( 'Dim date'[Date] ), ALLEXCEPT ( 'Dim date', 'Dim date'[Date].[Year], 'Dim date'[Date].[Month] ) ) ) )
YearMonth = FORMAT ( 'Dim Table2'[Date], "YYYYMM" )
Last day of each month = LOOKUPVALUE ( 'Dim Table2'[Date], 'Dim Table2'[YearMonth], TableName[YearMonth] )
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |