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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.