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