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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
njxfoster
Helper I
Helper I

Adding description to time measure

Hi Guys 

 

I have set a weekending measure to show the week starting date vs. the week ending date

njxfoster_0-1670972119912.png

njxfoster_1-1670972162308.png

 

For X-axis, is there a way I can change the display from showing "November 20" to " Week of 11/20"? 

 

 

Thanks in advance!

 

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

Hi  @njxfoster ,

I created some data:

vyangliumsft_0-1670981857137.png

Here are the steps you can follow:

1. Create calculated column.

Week = WEEKNUM('Table'[Date],2)
mindate =
var _weeknum=WEEKNUM('Table'[Date],2)
var _weekday=WEEKDAY('Table'[Date],2)
return
MINX(FILTER(ALL('Table'),'Table'[Week]=EARLIER('Table'[Week])),[Date])
Flag = "Week of" &" "& MONTH('Table'[mindate])&"/"&DAY('Table'[mindate])

2. Add Column – Index Column – From 1.

vyangliumsft_1-1670981857141.png

3. Create calculated table.

Table2 =
SUMMARIZE('Table','Table'[Flag],"Index",MINX(FILTER(ALL('Table'),'Table'[Flag]=EARLIER('Table'[Flag])),[Index]))

vyangliumsft_2-1670981857142.png

4. Join the relationship between two tables.

vyangliumsft_3-1670981857143.png

5. Column[Flag] – Column tools – Sort by column -- [Index] .

vyangliumsft_4-1670981857147.png

6. Result:

vyangliumsft_5-1670981857150.png

 

Best Regards,

Liu Yang

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

3 REPLIES 3
njxfoster
Helper I
Helper I

Hi Guys 

 

I have set a weekending measure to show the week starting date vs. the week ending date

njxfoster_0-1670972119912.png

njxfoster_1-1670972162308.png

 

For X-axis, is there a way I can change the display from showing "November 20" to " Week of 11/20"? 

 

 

Thanks in advance!

 

Anonymous
Not applicable

Yes but I don't believe it would ever be recommended.

 

The formula you have utilises data type Date or Date/Time. This maintains chronological settings.

 

You could create a custom column using the following code:

WeekOf = "Week Of " & FORMAT([WeekEnding], "mm/dd")
 
This introduces a host of issues though relating to data control due to a change in data types. To put "week of" into a column means your data type changes to Text. You will lose chronological control and your columns will be shown alphabetically (or alphanumerically based on the digit assignment). The only real way to control this would then be to create a separate table that has a ranking column next to it so you could list them in the order you want to.
 
If this is due to user preference then education/expectations management is key. 
v-yangliu-msft
Community Support
Community Support

Hi  @njxfoster ,

I created some data:

vyangliumsft_0-1670981857137.png

Here are the steps you can follow:

1. Create calculated column.

Week = WEEKNUM('Table'[Date],2)
mindate =
var _weeknum=WEEKNUM('Table'[Date],2)
var _weekday=WEEKDAY('Table'[Date],2)
return
MINX(FILTER(ALL('Table'),'Table'[Week]=EARLIER('Table'[Week])),[Date])
Flag = "Week of" &" "& MONTH('Table'[mindate])&"/"&DAY('Table'[mindate])

2. Add Column – Index Column – From 1.

vyangliumsft_1-1670981857141.png

3. Create calculated table.

Table2 =
SUMMARIZE('Table','Table'[Flag],"Index",MINX(FILTER(ALL('Table'),'Table'[Flag]=EARLIER('Table'[Flag])),[Index]))

vyangliumsft_2-1670981857142.png

4. Join the relationship between two tables.

vyangliumsft_3-1670981857143.png

5. Column[Flag] – Column tools – Sort by column -- [Index] .

vyangliumsft_4-1670981857147.png

6. Result:

vyangliumsft_5-1670981857150.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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