Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Comparing last year percentage to current and create a KPI

What I need to accomplish is comparing a current percentage point to last year's and then create an up or down KPI based on the difference between the two.  What I need help with is wrapping my head around the formula for last year's percent.  Here is what I have, which is not working and I will disect it some:

 

Last Year NOT = CALCULATE([SDNDR]/qryGetMEWO[Work Order Count] >=DATE(YEAR(TODAY()) - 1,3,31) && qryGetMEWO[ShortDate]<=DATE(YEAR(TODAY()) - 1,MONTH(TODAY()),DAY(TODAY())))

 

I want to get the percent dividing the count from SDNDR - which is already a measure that is working - by the Total Work Order Count, but filtering only on the date filter.  So if I am looking at the past 30 days, I want to look at the same 30 days from last year; if I am looking at yesterday, I want to compare last year yesterday.

 

Thanks for the help

 

 

1 ACCEPTED SOLUTION
BobBI
Resolver III
Resolver III

Hi,

SDNDR is alreay a measure

Create following measures

1.  TotalWorkOrder = Sum( workorder)  - to calculate total work order

 2.  Percentage = Divide( SDNDR,TotalWorkOrder)     - calculate %  ( this will show % for the current selected date )

 

3. Percentage(same period last year ) = Calculate (percentage,SAMEPERIODLASTYEAR(DateTable[Date]))  -  this will calcuate % for the same selected date but for the last year.

 

DateTable is a different table containing date file but you can use the date from the same table.

 

Hope this helps

 

good luck 🙂

 

Cheers!

Bob

 

View solution in original post

2 REPLIES 2
BobBI
Resolver III
Resolver III

Hi,

SDNDR is alreay a measure

Create following measures

1.  TotalWorkOrder = Sum( workorder)  - to calculate total work order

 2.  Percentage = Divide( SDNDR,TotalWorkOrder)     - calculate %  ( this will show % for the current selected date )

 

3. Percentage(same period last year ) = Calculate (percentage,SAMEPERIODLASTYEAR(DateTable[Date]))  -  this will calcuate % for the same selected date but for the last year.

 

DateTable is a different table containing date file but you can use the date from the same table.

 

Hope this helps

 

good luck 🙂

 

Cheers!

Bob

 

Anonymous
Not applicable

Thanks Bob.  This is exactly what I needed

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.