Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Percentage KPI Configuration

First of all, Hello everyone! My name is Nicolas and I'm new to this forum, I'm hopping to be an active member of this community and also be helped in my very unique Power BI Problems!

 

So let's cut to the chase... My problem is that I'm creating an inform with a table in which I offering a view of sales in a  weekly and monthly segmentation but my percentage indicator of YoY% only work with a date segmentation filter. The thing is that I'm using a column in my data table which have a formula with IF's and MAX's to mark only the dates I want to show in my inform without the need of changing the filters. For this table I'm not using any relations at all and the only filter I'm using is that column composed of 1's and 0's. 

 

Is there any way to make that indicator without making my report dependent on date filters?

 

This is the code of the indicator:

 

 

YoY% of Sales = 
IF(
	ISFILTERED('PPTOzv'[Sales]),
	ERROR("FAIL"),
	VAR __PREV_YEAR = CALCULATE(SUM('PPTOzv'[Sales]), DATEADD('PPTOzv'[Date].[Date], -1, YEAR))
	RETURN
		DIVIDE(SUM('PPTOzv'[Sales]) - __PREV_YEAR, __PREV_YEAR)
)

 

 

Thank you!

 

1 Reply