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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

 


@ 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!:
The Definitive Guide to Power Query (M)

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.