Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi all, I have a column called Fiscal Week Number and it has 1-27 weeks(I filtered 2020). Now for a KPI chart i have to display last 6 weeks and i am using C.Billings as a calculated measure . Please help me how to achieve it. I am using POWER BI default KPI card.
@v-jayw-msft
Solved! Go to Solution.
Hi, @harshagraj
Based on your description, I created data to reproduce your scenario.
Calendar(a calculated table):
Calendar = CALENDAR(DATE(2020,1,1),DATE(2020,12,31))
You may create a calculated column and a measure to diplay the data in last 6 weeks before today.
Calculated column:
weeknum = WEEKNUM('Calendar'[Date])
Measure:
var _cweeknum = WEEKNUM(TODAY())
var _weeknum = SELECTEDVALUE('Calendar'[weeknum])
var _cyear = YEAR(TODAY())
var _year = YEAR(SELECTEDVALUE('Calendar'[Date]))
return
IF(
_weeknum>=_cweeknum-6&&
_weeknum<=_cweeknum&&
_year=_cyear,
1,
0
)
Finally you may put the measure in the visual level filter. Here is the result. Today is 4/6/2020.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @harshagraj
Based on your description, I created data to reproduce your scenario.
Calendar(a calculated table):
Calendar = CALENDAR(DATE(2020,1,1),DATE(2020,12,31))
You may create a calculated column and a measure to diplay the data in last 6 weeks before today.
Calculated column:
weeknum = WEEKNUM('Calendar'[Date])
Measure:
var _cweeknum = WEEKNUM(TODAY())
var _weeknum = SELECTEDVALUE('Calendar'[weeknum])
var _cyear = YEAR(TODAY())
var _year = YEAR(SELECTEDVALUE('Calendar'[Date]))
return
IF(
_weeknum>=_cweeknum-6&&
_weeknum<=_cweeknum&&
_year=_cyear,
1,
0
)
Finally you may put the measure in the visual level filter. Here is the result. Today is 4/6/2020.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please create a week Rank,m using week start or week end date. That can we use to get the desired column
Refer this file : https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0