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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

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  @Anonymous ,

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  @Anonymous ,

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.

Anonymous
Not applicable

Bump..

selimovd
Super User
Super User

Hey @Anonymous ,

 

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
 
Anonymous
Not applicable

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.