Forum Discussion
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
- SeanCommunity 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
- AnonymousNot applicableHi,
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.- shamsuddeenvpPost Patron
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
- SeanCommunity Champion
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.
Also it seems you are desribing either a custom Visual or KPIs imported from PowerPivot like this..
See my answer here...