As you can see from the screenshot, the “period % of total lines” is calculating for all dates. I want to be able to use the slicer and I’m struggling to get the right formula. I have tried ALL, ALLSELECTED, etc and either get 100% per line or the % based on all periods. I basically want the results in the first two columns (S2K Total Lines and S2K % of Total Lines) to be dynamic with the period slicer (Period Order Lines and Period % of Total Lines)
OLD - I used this with a relative filter on date column - this worked fine but I was stuck with a relative time period:
S2K Total Lines = CALCULATE(COUNT(fact_S2K_Sales_Master[Order Number]),fact_S2K_Sales_Master[Order Type] = “O”)
S2K % of Total Lines =
DIVIDE([S2K Total Lines],
CALCULATE(COUNT(fact_S2K_Sales_Master[Order Number]),
fact_S2K_Sales_Master[Order Type] = “O”,
ALLSELECTED()))
NEW with Date range slicer (past 3M, 6M, 12M) - NOT WORKING
Period Order Lines =
CALCULATE( [S2K Total Lines],
FILTER(dim_Dates,
dim_Dates[Date] > TODAY() - [Selection Days] && dim_Dates[Date] <= TODAY() ))
Period % of Total Lines =
DIVIDE([Period Order Lines],
CALCULATE(COUNT(fact_S2K_Sales_Master[Order Number]),fact_S2K_Sales_Master[Order Type] = “O”,
ALLSELECTED()))
PBIX is too large to share but I have added measures above. Thanks!