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! Request now

Reply
Anonymous
Not applicable

Table made by DAX formulas using SELECTEDVALUE

Hey Guys!

 

What I want to do is a Relative Date Table based on my filter selection on the visual report. I mean, I know the relative data feature, but I need the 12 months after and before the date I have selected in my filter. 

 

I've tried making a table using DAX like this, but the function selectedvalue is not working inside the formula. 

 

RelativeDate=

ADDCOLUMNS(

CALENDAR(DATE(SELECTEDVALUE(SOP_Selection[year])-1,SELECTEDVALUE(SOP_Selection[Month]),1),DATE(SELECTEDVALUE(SOP_Selection[year])+1,SELECTEDVALUE(SOP_Selection[Month]),1)),

"Year", FORMAT([Date], "YYYY"),

"Month", FORMAT([Date], "MM"),

"Year-Month", FORMAT([Date], "MM/YY"))
 
Does anyone know how to fix it? Or another way to have personalized data based on my filter selection?  
1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi, @Anonymous 

First, let's explain that slicer selection belongs to the filtering context and can only be used on our report page. And both the new table and the new computed column belong to the row context and cannot use the selected values of our slicers.

For this, you can simply create a new computed column and use the selectedvalue() function, then change the selection of your slicer, and then you will find that it will not change, for proof.

 

For date tables, we can only build the date range you want according to our needs, and we can't create a date table that will change more than slicer filtering.

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

3 REPLIES 3
v-yueyunzh-msft
Community Support
Community Support

Hi, @Anonymous 

First, let's explain that slicer selection belongs to the filtering context and can only be used on our report page. And both the new table and the new computed column belong to the row context and cannot use the selected values of our slicers.

For this, you can simply create a new computed column and use the selectedvalue() function, then change the selection of your slicer, and then you will find that it will not change, for proof.

 

For date tables, we can only build the date range you want according to our needs, and we can't create a date table that will change more than slicer filtering.

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Anonymous
Not applicable

Thank you so much! I understood the concept.

amitchandak
Super User
Super User

@Anonymous , A calculated table can not use a slicer value.

 

A table inside var of measure can use

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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