cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ivyhai
Post Patron
Post Patron

Column Chart X-Axis Date Formatting to Weekend date

I've created a weeknumber use below calculation, the chart now give me the value in week 1 and week2, is there anyway i can change them to weekending date, for example, 1 to be 7/01/2017 and 2 to be 14/1/2017? 

 

WeekNum = WEEKNUM(mag_pledgeSet[mag_EstablishedDate].[Date])

 

CRM.PNG

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @ivyhai,

 

In your scenario, you can create a Calendar table and build a relation between Fact table and Calendar table use date. Then create a calculated column in Fact table like below:

 

LastDayofWeek = CALCULATE( MAX( 'Calendar'[Date] ), FILTER( ALL( 'Calendar' ), 'Calendar'[weenum]= EARLIER( 'Fact'[WeekNum] ) ))

 

q1.PNGq2.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
v-qiuyu-msft
Community Support
Community Support

Hi @ivyhai,

 

In your scenario, you can create a Calendar table and build a relation between Fact table and Calendar table use date. Then create a calculated column in Fact table like below:

 

LastDayofWeek = CALCULATE( MAX( 'Calendar'[Date] ), FILTER( ALL( 'Calendar' ), 'Calendar'[weenum]= EARLIER( 'Fact'[WeekNum] ) ))

 

q1.PNGq2.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-qiuyu-msftit's working beautifully! thanks!

@v-qiuyu-msftHow can you get the "07 Jan" but my was on "8/January"  the best i can do on data "format"

 

CRM.PNG

CRM.PNG

Hi @ivyhai,

 

Please check how you create a calculated column to return weeknum both in Fact and Calendar table. I guess the issue should be related to WeekNum() function:  WEEKNUM(<date>, <return_type>) .

 

Return type: 1, week begins on Sunday.

Return type: 2, week begins on Monday.

 

Please download attached in my previous post and compare it with your report.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-qiuyu-msft it works, i used "2" week begins on Monday.  it just my format is diffent from yours, and i prefer it's in short. which is 7 Jan (on yours) not 7/January (on mine).  just wonder how you set your data format,  i've tried them all already. 

Hi @ivyhai,

 

I'm running Power BI desktop latest version 2.42.4611.701 and just set format like below:

 

q4.PNGq5.PNG

 

 

Best Regards,

Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-qiuyu-msfti've changed format like yours, the "Digital" now correct but not the "F2F" do you know why?  plus i've checked the dates for F2F, there is no 10 Jan and 12 Jan dates. 

CRM.PNG

CRM.PNG

CRM.PNG

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.