The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I have issue that my slicer is not working with my WOW%, sales last week measures.
It's shows empty values in table, but it's works fine without filtering
Sales last week =
Calculate (
SUM( Table[sales]),
FILTER( ALL( table[week]),
table[week]=MAX(table[week])-1))
Sales this week =
Calculate (
SUM( Table[sales]),
FILTER( ALL( table[week]),
table[week]=MAX(table[week])))
WOW% = DIVIDE(
Sales last week - Sales this week, Sales lastweek week)
please help me on this, appreciate it
Solved! Go to Solution.
Hi @Xavius
see my last reply
Sales last week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( table[week] ),
table[week] = MAX( table[week] ) - 1
)
Sales this week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( table[week] ),
table[week] = MAX( table[week] )
)
or
Sales last week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( ),
table[week] = MAX( table[week] ) - 1
)
Sales this week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( ),
table[week] = MAX( table[week] )
)
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Hi @Xavius - as per above image, we can tweak the filter to removefilter function as below:
Sales last week =
CALCULATE(
SUM( Table[sales] ),
FILTER(
REMOVEFILTERS( table[week] ),
table[week] = MAX( table[week] ) - 1
)
)
also in this week as well: use removefilter:
Sales this week =
CALCULATE(
SUM( Table[sales] ),
FILTER(
REMOVEFILTERS( table[week] ),
table[week] = MAX( table[week] )
)
)
now you can find the percentage.
Hope this helps.
Proud to be a Super User! | |
REMOVEFILTERS is not a table function so you cannot write
FILTER (
REMOVEFILTERS ( ), -- here you get an error
....
)
The correct DAX is
Sales last week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( table[week] ),
table[week] = MAX( table[week] ) - 1
)
also in this week as well: use removefilter:
Sales this week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( table[week] ),
table[week] = MAX( table[week] )
)
Finally, it might be that the REMOVEFILTERS called is not enough (there might be multiple filters applied), in that case
Sales last week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( ),
table[week] = MAX( table[week] ) - 1
)
Sales this week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( ),
table[week] = MAX( table[week] )
)
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Thanks @FBergamaschi
I forgot to remove the filter function on the top ..
Anyway it worked finally with removefilter function
Proud to be a Super User! | |
It worked but when I put the region all the values will be repeated to the total
Which of the two code versions I gave you worked?
What table does the column region come from? Has this table a relationship to the table Table?
Sales last week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( table[week] ),
table[week] = MAX( table[week] ) - 1
)
This one.
Unfortunately I cannot share the table yet
buy
I have column weeks like W 2025/01, region , sales column , year column include 2025,2024
and I have calculated week column that substitute the "/", "W" from week column
cause it's not accepted in last weeksales measure
that's it
And it's one table no other tables
Unfortunately, it's not working at all 🥹
Hi @Xavius
see my last reply
Sales last week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( table[week] ),
table[week] = MAX( table[week] ) - 1
)
Sales this week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( table[week] ),
table[week] = MAX( table[week] )
)
or
Sales last week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( ),
table[week] = MAX( table[week] ) - 1
)
Sales this week =
CALCULATE(
SUM( Table[sales] ),
REMOVEFILTERS( ),
table[week] = MAX( table[week] )
)
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Please show the issue with some image, explain what you are filtering
I'm trying to filter the week in slicer
this sales week measure show numbers no issue.
but the last sales week, and wow% measure.
cause they contains -1 inside whenever I filter the week it's show empty in table