Answer : (?)
Good evening @ibesmond
A possible workout for your dilemma 2: “Are there any Product/Location/Warehouse with over/short more than +/- $150, unless the variance is +/- 10%?” is presenting outliers.
Do you expect an integration of the two (variance and over/short) ? What do you mean with “unless” ?
PBIX attached:
7-Day consecutive sample (DS reaction).pbix (103.1 KB)
Set up of a possible outlier presentation, made for both Variance % and Over short balance.
- Add a parameter (Modeling – New Parameter), which adds a new slicer to select above which values the outliers should be presented, default set to 10 % and for the second to 150
Abs Variance Percentage% = GENERATESERIES(0, 25, 1)
ABS.Variance Percentage = SELECTEDVALUE('Abs Variance Percentage%'[ABS Variance Percentage (%)], 5)
- Create the outlier measure (1 of 2 presented)
Variance outlier = IF(abs([Variance]) >= [ABS.Variance Percentage] / 100 , [Variance], BLANK())
-
Add a table with data, comparing the variance % and the outlier variance % for verification
-
Add a stacked column chart with the outlier variance % by date
Formatting made in the graph :
- visualisations – Format visual – Visual – X-axis – Type : set to Categorial, to present only dates with outlier values
- visualisations – Format visual – Visual – Columns – Color – Color fx : set a red green color range, including automatic minimal and maximal variance %
Resulting in :
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dilemma 1 "Are there any Product/Location/Warehouse with over/short for 7 consecutive days?
( 7-day count should not include days with no sales or weekends) " is complex . .
Albert Ferrari has given an explanation of consecutive sales days, which can be found at https://www.youtube.com/watch?v=E5VZ6k9kk60
The complexity with Over / Short billing is that it a combination of two, Over and Short, which can not be compared to one item Sales as in the example. It interferes with each other. How should the combination be treated in the outcome, and different consecutive number values (150 Over, next -10 Short) are irrelevant? What is the exact definition of consecutive for the Over/short numbers ?
AF1 Consecutive days of sales = //Albert Ferrari https://www.youtube.com/watch?v=E5VZ6k9kk60
Var RefDate = MAX(DateT[Date])
Var AllDates = All (DateT[Date])
Var DatesWithSales = CALCULATETABLE(VALUES(FactTable[Date]),ALLSELECTED())
Var DateswithNoSales = EXCEPT(AllDates, DatesWithSales)
Var NearestHoleSales = MAXX( FILTER( DateswithNoSales, DateT[Date] <= RefDate),DateT[Date]) //can be empty if every day generates sales
Var MinimumDate = CALCULATE(MIN(DateT[Date]), REMOVEFILTERS(DateT[Date])) // DS needed if table "NearestHoleSales" is Empty
Var ResultConsecutiveSalesDays = if(ISBLANK(NearestHoleSales),INT(RefDate - MinimumDate+1),INT(RefDate - NearestHoleSales)) //when every day gives sales,(ISBLANK), consecutive sales is min date till ref.date
RETURN ResultConsecutiveSalesDays
I hope this helps you a step further.
Kind regards Jan vd Wind