The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I am preparing a report in Power BI desktop.It has to represent the data acrosss different weeks.
Pease find the screenshot below:
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)
Solved! Go to 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 ) )
Best Regards,
Angelia
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 ) )
Best Regards,
Angelia