Forum Discussion
KPI Visual - target value
- 2 years ago
Hi Berrcikk
You can use isinscope function to manipulate with the date hierarchies and calculate your goal according to the selections.
Please refer to the attached video :
https://www.youtube.com/watch?v=_p9E8fiDRDwIf this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- 2 years ago
Hi Berrcikk
You need to apply the needed logic for goals based on the hierarchy filter, if i understood you correctly, on year it should be a year ago, quarter, quarter ago, etc .
So it something like :
test isincscope =
VAR date1 =
MAX ( DimCalendar[Date] )
VAR vMonth =
CALCULATE (
SUM ( vFactSales[Total Sales] ),
datedadd( vFactSales[Date] ,-1,month)
)
VAR vQuarter =
CALCULATE (
SUM ( vFactSales[Total Sales] ),
datedadd( vFactSales[Date] ,-1,quarter)
)
VAR vYear =
CALCULATE (
SUM ( vFactSales[Total Sales] ),
datedadd ( vFactSales[Date] ,-1,Year)
)
VAR scope1 =
SWITCH (
TRUE (),
ISINSCOPE ( DimCalendar[Date].[Month] ), vMonth,
ISINSCOPE ( DimCalendar[Date].[Month] ), vQuarter,
ISINSCOPE ( DimCalendar[Date].[Month] ), vYear,
1
)
RETURN
scope1
Hi Berrcikk
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523