Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have a date column that i need to create a new column based on it, the new column should show the next six months with saturday as the end day.
Hi @Anonymous ,
What does your data look like? If you want to generate a new column, the number of rows of the newly generated column must be the same as the original number, otherwise an error will occur.
Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?
Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Refer to:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Basically i wanted to know if there is a way to modify this logic to say return the next 6 months ending on a saturday
@Anonymous Maybe something like:
Column =
VAR __Today = TODAY()
VAR __SixMonths = EOMONTH( __Today, 6 )
VAR __Calendar =
ADDCOLUMNS(
CALENDAR( __Today, __SixMonths ),
"__WeekDay", WEEKDAY( [Date], 2 )
)
VAR __MaxDate = MAXX( FILTER( __Calendar, [__WeekDay] = 6 ), [Date] )
VAR __Result = FILTER( __Calendar, [Date] <= __MaxDate )
RETURN
__Result
I tried but getting this error
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.