Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I am trying to achieve TOP & keep getting BOTTOM (error).
DAX used:
Solved! Go to Solution.
Hi @celine9090 ,
I created the data:
Table:
Date Table:
Here are the steps you can follow:
1. Create meausre.
Total = SUMX(FILTER(ALL('Table'),'Table'[Month]=MAX('Date'[Month])),'Table'[amount])
Result:
Flag =
var _selectvalue=SELECTEDVALUE('Slice'[Month])
return
IF(MAX('Date'[Month]) <=_selectvalue,1,0)
2. Use enter data to create a Slice table.
3. Set the Month of the Slice table as the slicer.
4. Put Flag into Filter, set is =1, and apply filter.
5. Result.
When the slicer is 3, the data of the previous three months is displayed.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @celine9090 ,
I created the data:
Table:
Date Table:
Here are the steps you can follow:
1. Create meausre.
Total = SUMX(FILTER(ALL('Table'),'Table'[Month]=MAX('Date'[Month])),'Table'[amount])
Result:
Flag =
var _selectvalue=SELECTEDVALUE('Slice'[Month])
return
IF(MAX('Date'[Month]) <=_selectvalue,1,0)
2. Use enter data to create a Slice table.
3. Set the Month of the Slice table as the slicer.
4. Put Flag into Filter, set is =1, and apply filter.
5. Result.
When the slicer is 3, the data of the previous three months is displayed.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Bump..
Hey @celine9090 ,
can you create a new measure with "selectedvalue('Date'[Month])" and return that in a card visual?
Does it return "3" or "March"?
If it returns "March" then the formula with > 4 wouldn't work. You could then do a lookup.
Let me konw, I can help you with that.
Hello.. it returns a "3" not march so im confused why it wouldn't work!
Here is the [date] table if anything can be used:
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.