Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Next six moths ending on a saturday

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.

4 REPLIES 4
v-jianboli-msft
Community Support
Community Support

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.

Anonymous
Not applicable

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

PMDueFilter =
VAR _datetable = PMDueTable

VAR _twentyone = TODAY()+21


RETURN UNION(
 
    ADDCOLUMNS(FILTER(_datetable,_twentyone >=[Date] && [Date] >= TODAY()),"Period","Next 21 Days","Order",1),
    ADDCOLUMNS(_datetable,"Period","Custom Date Range...","Order",2))

@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

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

I tried but getting this error 

 

The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.