Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hi,
I have year and quarter columns, I need to create a calculated column from which I can get the date through this year and quarter columns, i.e., the date may be any either 1st of any month or in between the months.
Eg., Year 2022 quarter Q2 then date can be 04/05/2022 or 01/05/2022 etc.
I cannot use custom column.
Solved! Go to Solution.
Hi @Haripinnoju ,
Cannot use a calculated column to insert rows, the rows in the calculated column are the same as the rows in the table.
Consider creating a new table.
Table 2 =
VAR _min_year =
MIN ( 'Table'[Year] )
VAR _min_year_quarter =
INT (
RIGHT ( CALCULATE ( MIN ( 'Table'[Quarter] ), 'Table'[Year] = _min_year ), 1 )
)
VAR _max_year =
MIN ( 'Table'[Year] )
VAR _max_year_quarter =
INT (
RIGHT ( CALCULATE ( MIN ( 'Table'[Quarter] ), 'Table'[Year] = _min_year ), 1 )
)
VAR _table =
CALENDAR (
DATE ( _min_year, 3 * _min_year_quarter - 2, 1 ),
DATE ( _max_year, _max_year_quarter * 3, 1 )
)
RETURN
_table
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi @Haripinnoju ,
Cannot use a calculated column to insert rows, the rows in the calculated column are the same as the rows in the table.
Consider creating a new table.
Table 2 =
VAR _min_year =
MIN ( 'Table'[Year] )
VAR _min_year_quarter =
INT (
RIGHT ( CALCULATE ( MIN ( 'Table'[Quarter] ), 'Table'[Year] = _min_year ), 1 )
)
VAR _max_year =
MIN ( 'Table'[Year] )
VAR _max_year_quarter =
INT (
RIGHT ( CALCULATE ( MIN ( 'Table'[Quarter] ), 'Table'[Year] = _min_year ), 1 )
)
VAR _table =
CALENDAR (
DATE ( _min_year, 3 * _min_year_quarter - 2, 1 ),
DATE ( _max_year, _max_year_quarter * 3, 1 )
)
RETURN
_table
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi @Haripinnoju it seems you need to create Date table in Power BI. Check link. I hope this help https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Proud to be a Super User!
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.