Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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:
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |