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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
sajal161292
Helper V
Helper V

Error in representing the data in a matrix visual in power BI

Hi,

 

I am preparing a report in Power BI desktop.It has to represent the data acrosss different weeks.

 

Pease find the screenshot below:

 

powerbi6.PNG

As illustrated in the screenshot it is taking 2018-11 after 2018-1 instaed of 2018-2.

So can anyone help me in fixing this bug.

 

I have used this DAX expression for the week

 

Week = 'Calendar'[Year] & "-" & WEEKNUM('Calendar'[Date],2)

 

1 ACCEPTED SOLUTION

Hi @sajal161292,

Please create the calculated column Week using the formula below. You will get expected result as the screenshot shown.

Week =
IF (
    WEEKNUM ( 'Calendar'[Date], 2 ) <= 9,
    'Calendar'[Year] & "-"
        & "0"
        & WEEKNUM ( 'Calendar'[Date], 2 ),
    'Calendar'[Year] & "-"
        & WEEKNUM ( 'Calendar'[Date], 2 )
)


1.PNG

Best Regards,
Angelia

View solution in original post

3 REPLIES 3
jthomson
Solution Sage
Solution Sage

It's not a bug per se, it's sorting it correctly based on it being a text field you're creating. If you're happy with a week displaying as 2018-01, look to add an if statement into your expression to concatenate in a 0 if your week number is less than 9

Hi,

 

Can you help me with its DAX expression ?

 

Thanks

Hi @sajal161292,

Please create the calculated column Week using the formula below. You will get expected result as the screenshot shown.

Week =
IF (
    WEEKNUM ( 'Calendar'[Date], 2 ) <= 9,
    'Calendar'[Year] & "-"
        & "0"
        & WEEKNUM ( 'Calendar'[Date], 2 ),
    'Calendar'[Year] & "-"
        & WEEKNUM ( 'Calendar'[Date], 2 )
)


1.PNG

Best Regards,
Angelia

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors