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
shamsuddeenvp
Post Patron
Post Patron

KPI visual in Power BI

Dear,

 

I need to have a KPI, which shows sales comparing to the previous year for all the filter selection.

 

I created a measure using SAMEPERIODLASTYEAR function, however it doesnt work properly with the existing KPI visual in ower BI Desktop.

 

Can anybidy guide on this. Req is to have a value which gives % variance compared to previous year value.

 

Br,

Shamsuddeen

7 REPLIES 7
Anonymous
Not applicable

Hi,
If your requirement is using the DAX formula u mentioned above, then
Try joining the Date field of your fact table, with date dimension.
Then perform the calculation. Let me know if it works.

Thanks @Anonymous and @Sean for your inputs.

 

I need not to have a trend, just need to have a comparison with current value with the previous year. and shows the variance value. How to implement that in Power BI dekstop with the arrows (red or green) which changes dynamically based on the variance.

 

Below is 

I am trying to use the the KPI visual which is there in out of the box.

 

I have calculated a measure 

lastPeriodValArr:=CALCULATE(
COUNTROWS('Arrival')
,SAMEPERIODLASTYEAR('Date'[Date])
,AllExcept('Date', 'Date'[Date])
)

 

I have added Month_Name in trend.

 

Value: Current duration value

 

Target: Above measure

 

It looks fine (we need to select some year to claculate the previous year), Actually Dashboard shows all the values  (not filters any year) at load and this KPI shows error since user not selected any year or any filter which calculates lastyearperiodvalue.

 

Error: "SAMEPERIODLASTYEAR only works with contiguous date selection."

 

Br,

Shamsuddeen

@shamsuddeenvp Are you trying to do Month on Month? Why are you using Month_Name in trend?

 

And even then you should use year - just change the Measures.

 

KPI2.png

 

Also it seems you are desribing either a custom Visual or KPIs imported from PowerPivot like this..

See my answer here...

http://community.powerbi.com/t5/Desktop/Is-it-possible-to-create-a-similar-report-visual/m-p/37568#M...

 

KPIs2.png

Thanks @Sean

 

Yes, I need to show the trend by month. still I need to keep year in trend field?

 

Actually my requirement is that I need to show a trend graph in a way that what is the total sales this month and compare the value with previous year same perid sales.

 

Other screenshot you mentioned also useful for my requirement to show all the months variance between current value and previous year value in table format, however that would need to create KPI in powerpivot or in SSAS tabular model right?

 

Thanks!

Shamsuddeen

 

 

 

@shamsuddeenvp Yes to both quesitions.

 

I would consider using a different visual - you don't have that much flexibility with the built in KPI

 

Look the charts look the same shape but the PBI built-in KPI will give you pretty much no details...

 

MoM% vs KPI.png

Thanks @Sean

 

Please let me know if there is any feasibility to have a green Top directed arrow (Image) and red downward arrow to show whether the value is growing or shrinking. This image dynamically should change based on the variance value.

 

Br,

SHamsuddeen

Sean
Community Champion
Community Champion

@shamsuddeenvp What exactly is not working properly? The Measure or what you are seeing in the Visual?

 

Generally without knowing any details for YoY (arrange the fields like this)

Indicator => YTD

Trend Axis => Year

Target Goal => YTD Same Period Last Year Measure

 

KPI.png

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.