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
Kumar_rohit4
Frequent Visitor

same period last year count based on the teams.

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

 

Kumar_rohit4_2-1636737685299.png

 

 

 

Do let me know if i can do something to make this work

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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

Capture.PNG

 

Best Regards,

Jay

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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

Capture.PNG

 

Best Regards,

Jay

amitchandak
Super User
Super User

@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)))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@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?

 

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.