Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I created a slicer and a measure, and the measure works fine in the card object.
When I want to use the measure in a new table, it doesn't work and returns a value of "2022-8-5".
At this Link learned that ABC cannot be used in new tables.
SELECTEDVALUE doesn't work in a measure table - Microsoft Fabric Community
But I have to connect with the slicer in a new table, is there any other way?
Data =
Var SelectedDate = 'Calendar'[SelectedDate] //this is a measure.
var MaxYear = YEAR(SelectedDate)
var MaxMonth = MONTH(SelectedDate)
var MaxWeek = WEEKNUM(SelectedDate)
return
UNION(
//年 - 小于筛选年份的所有行.
//Year - All rows that are less than thse filtered year.
ADDCOLUMNS(FILTER(Source,Source[Year] <= MaxYear), "Axis",Source[Year], "Order",Source[Year] * 1),
//月 - 筛选年份小于筛选月份的所有行.
//year month - All rows with a filter year less than the filter month.
ADDCOLUMNS(FILTER(Source,Source[Year] = MaxYear && Source[Month] <= MaxMonth), "Axis",Source[YearMonth], "Order",Source[Month] * 10000),
//周 - 筛选年份&筛选月份的所有行.
//year week -
ADDCOLUMNS(FILTER(Source,Source[Year] = MaxYear && Source[Month] = MaxMonth), "Axis",Source[YearWeek], "Order",Source[Week] * 1000000),
//日 - 筛选年份&筛选月份&筛选周的所有行.
//year week day
ADDCOLUMNS(FILTER(Source,Source[Year] = MaxYear && Source[Month] = MaxMonth && Source[Week] = MaxWeek), "Axis",Source[YearWeekDay], "Order",Source[WeekDay] * 100000000)
)
Solved! Go to Solution.
Hi @szhong6 ,
You mentioned that when you use the SELECTEDVALUE function in a normal data table, it works fine. However, when you apply it in a table created by a DAX formula, it doesn’t work as expected.
The reason for this behavior lies in how calculated tables are evaluated. Unlike columns in a normal data table, calculated tables are static and do not dynamically update based on slicer interactions.
powerbi - Using DAX with a SELECTEDVALUE From Slicer Not Working correctly - Stack Overflow
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @szhong6 ,
You mentioned that when you use the SELECTEDVALUE function in a normal data table, it works fine. However, when you apply it in a table created by a DAX formula, it doesn’t work as expected.
The reason for this behavior lies in how calculated tables are evaluated. Unlike columns in a normal data table, calculated tables are static and do not dynamically update based on slicer interactions.
powerbi - Using DAX with a SELECTEDVALUE From Slicer Not Working correctly - Stack Overflow
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The chart I want to implement is something like this, showing different levels of content in the same column chart, and it's already done.
But I also wanted it to be able to link with the slicer.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |