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

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 @Anonymous,

 

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 @Anonymous,

 

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.
Anonymous
Not applicable

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

Anonymous
Not applicable

@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 @Anonymous,

 

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.
Anonymous
Not applicable

@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 @Anonymous,

 

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.
Anonymous
Not applicable

@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
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.