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

KPI Visual Goal - Based off previous month's data

I'm having trouble with the Goal piece of the new KPI Visual.  The overview of the feature in the video simply created a goal based off the current month's count.  This doesn't really make sense.  I'm trying to set the goal to be based off a previous month's value.  But, as soon as I set the new measure, it's broken down by month (the trend axis for the visual).  This means the goal I set is only ever based off the current month's value, which is not a useful metric.  Is there a way to set the target goal based off another field already in the data that aggregates based on a previous month's data? 

 

Hope that makes sense.  I've tried everything I can think of, and no matter what formula I create, it will only set the goal based on the current month's data. 

6 REPLIES 6
Tsanka
Kudo Collector
Kudo Collector

I am using this visual. In my case the indicator is the current month revenue and the goal is a measure for previous month MTD revenue. The trend axis I use is the date hierarchy (Date-Year).

 

This setup works okay for me, the only problem is when there is no data for the previous month. Then the visual displays blank, which is not correct as in my case  it should display the current month revenue.

 

Hope that helps 

 

Goal.png

Rachel
Frequent Visitor

That's helpful if the data is entered aggregated by row, looks like in this example the data has one line per month.  But my data is entered in one row per user per month.  I'm looking for a KPI based on the count of users for the month, and want to compare that to the count of users for the past month.  All the data is there, but it's not aggregated on a per month basis when I load it in, I feel like Power BI should be able to handle this and allow for aggregating within the report creation.   I need to have the individual data by row so I can add slicers to allow for the user to filter it based on differnt product categories, so aggregating it before uploading it won't make sense for my use case.

  KPI Visual.PNG

@Rachel,

 

Did you get any further on this issue?

I am just looking into a simillar data set and would like to try and utilise the data in a KPI; the closest I got was, as you described an new column/measure. That is the current and previous month calculation using the previousmonth function and summing the columns, then divide them and convert to percentage.

 

Regards,

 

 

Daniel Clark
Business Insight Data Modeler @ BRIGHTSTARR

@DanielClark

 

I did figure out how to do this eventually.  You do need to create a new measure, that aggregates the data, and then I used the SAMEPERIODLASTYEAR function, nested in the DATESMTD or DATESYTD function, for Year over Year comparisons.

 

Hope that makes sense, and helps!  It works quite nicely this way, and allows for filtering on different segments.

Ah okay, that is not quite what I was looking for as I need to compare with the previous month (I have been trying to use the PREVIOUSMONTH fucntion), but the DATESMTD and DATESYTD are both functions that I had not used before and they look like they will be very useful for shorter/longer comparisons. I'll give them a go!

Thanks for the reply!

Daniel Clark
Business Insight Data Modeler @ BRIGHTSTARR

I found this formula sales_last_month = calculate(sum('Table'[Sales]), PARALLELPERIOD('Table'[Date],-1,MONTH)) here https://community.powerbi.com/t5/Desktop/Compare-previous-and-new-sales/td-p/9872

 

I haven't tried it yet, but that might work for what you're trying to do. 

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.