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.
I was looking to get the last year week numbers to the current year week
I have created one calculated column and one measures named
DWY = GICC_Incident_View[week]*10000+GICC_Incident_View[FiscalYear]
Measure 2 = CALCULATE([CY INC minus LY INC],FILTER(ALLSELECTED(GICC_Incident_View),GICC_Incident_View[DWY]=MAX(GICC_Incident_View[DWY])-1))
But when the measure doesn't gives anu result based on the teams (attached image).
Do let me know if i can do something to make this work
Solved! Go to Solution.
Hi @Kumar_rohit4 ,
Put the [DWY] column in the visual and the measure will recognize MAX(GICC_Incident_View[DWY])-1 in the formula.
Measure = CALCULATE([CY INC minus LY INC]),FILTER(ALLSELECTED(GICC_Incident_View),GICC_Incident_View[DWY]=MAX(GICC_Incident_View[DWY])-1))
Best Regards,
Jay
Hi @Kumar_rohit4 ,
Put the [DWY] column in the visual and the measure will recognize MAX(GICC_Incident_View[DWY])-1 in the formula.
Measure = CALCULATE([CY INC minus LY INC]),FILTER(ALLSELECTED(GICC_Incident_View),GICC_Incident_View[DWY]=MAX(GICC_Incident_View[DWY])-1))
Best Regards,
Jay
@Kumar_rohit4 , if you have date, year week, Create date and week table and then you can try measures like
But use separate table
measure
YTD= CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) && 'Date'[Week] = Max('Date'[Week]) ))
LYTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year])-1 && 'Date'[Week] = Max('Date'[Week])))
or
a new column
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
measures
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Last year Week= CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=(max('Date'[Week Rank]) -53)))
@amitchandak Acutally i have columns Fiscal year, Faiscal week , Fiscal Month but not any date column. can you please let me know if thiws can be used to get the last year count for same period of the teams without using any extra table?