Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
celine9090
Frequent Visitor

Help.. Selectedvalue issue / chart

Help.jpg

I am trying to achieve TOP & keep getting BOTTOM (error).

 

DAX used:

Var Y2021 = ...
return
if(selectedvalue('Date'[Month]) > 3*, blank(), Y2021) 
*Edited
 
I will get "TOP" (desired)
 
Help2.JPG'Date'[Month] = 3 in this case (value)
But I am trying to sync my slicer here as well. E.g. if March selected, April onwards should not be showing any figure. So I tried below DAX
 
if(selectedvalue('Date'[Month]) > selectedvalue('Date'[Month]), blank(), Y2021)
 
It wont work. Why?!
I am trying to change the "4" to a valid DAX but cant figure for the life of me what to do. Please help me.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @celine9090 ,

I created the data:

Table:

v-yangliu-msft_0-1622711446281.png

Date Table:

v-yangliu-msft_1-1622711446299.png

Here are the steps you can follow:

1. Create meausre.

Total = SUMX(FILTER(ALL('Table'),'Table'[Month]=MAX('Date'[Month])),'Table'[amount])

Result:

v-yangliu-msft_2-1622711446303.png

Flag =
var _selectvalue=SELECTEDVALUE('Slice'[Month])
return
IF(MAX('Date'[Month]) <=_selectvalue,1,0)

2. Use enter data to create a Slice table.

v-yangliu-msft_3-1622711446304.png

3. Set the Month of the Slice table as the slicer.

4. Put Flag into Filter, set is =1, and apply filter.

v-yangliu-msft_4-1622711446306.png

5. Result.

When the slicer is 3, the data of the previous three months is displayed.

v-yangliu-msft_5-1622711446308.png

 

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.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi  @celine9090 ,

I created the data:

Table:

v-yangliu-msft_0-1622711446281.png

Date Table:

v-yangliu-msft_1-1622711446299.png

Here are the steps you can follow:

1. Create meausre.

Total = SUMX(FILTER(ALL('Table'),'Table'[Month]=MAX('Date'[Month])),'Table'[amount])

Result:

v-yangliu-msft_2-1622711446303.png

Flag =
var _selectvalue=SELECTEDVALUE('Slice'[Month])
return
IF(MAX('Date'[Month]) <=_selectvalue,1,0)

2. Use enter data to create a Slice table.

v-yangliu-msft_3-1622711446304.png

3. Set the Month of the Slice table as the slicer.

4. Put Flag into Filter, set is =1, and apply filter.

v-yangliu-msft_4-1622711446306.png

5. Result.

When the slicer is 3, the data of the previous three months is displayed.

v-yangliu-msft_5-1622711446308.png

 

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.

celine9090
Frequent Visitor

Bump..

selimovd
Super User
Super User

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.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

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:

Help3.JPG

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors