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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Analitika
Post Prodigy
Post Prodigy

Year week in Power BI

Hello,

 

I would like to get concatenated year week in table visual in Power BI. Having column Week number. I got this result:

Analitika_0-1653378844666.png

Seems year week is unsorted. I used this formula to for column Year week. 

Year_week = FORMAT('Date'[Date],"YYYY") & "-" &'Date'[Week Number]
Week Number = WEEKNUM('Date'[Date],1).
 
How to resolve this issue by making ascending order year_week?
 

 

1 ACCEPTED SOLUTION

Hi @Analitika,

You can add a calculated column to extract the year and week number value from the date to concatenate and convert to numeric, then these values can be sorted by ASC/DESC order on your visuals.

YearWeek =
YEAR ( 'Table'[Date] ) * 100
    + WEEKNUM ( 'Table'[Date], 2 )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
Analitika
Post Prodigy
Post Prodigy

Hello,

 

I would like to ask how I can sort ascending column which is constructed from year and week. I am getting year week column but sorting is not as in normal case. For example,

Analitika_0-1653386509177.png

Year_week = FORMAT('Date'[Date],"YYYY") & "-" &'Date'[Week Number]
Week Number = WEEKNUM('Date'[Date],1)
Formulaes.

Hi @Analitika,

You can add a calculated column to extract the year and week number value from the date to concatenate and convert to numeric, then these values can be sorted by ASC/DESC order on your visuals.

YearWeek =
YEAR ( 'Table'[Date] ) * 100
    + WEEKNUM ( 'Table'[Date], 2 )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.