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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
psfard85
Frequent Visitor

Using Selectecvalue() for filtering a summerized Table

Hi everybody,

here is my problem; I wrote this Dax and it is working flawlessly:

TTBL =
                 var tableSummerize=
                          CALCULATETABLE(
                                    SUMMARIZE(
                                         Sheet1,
                                         Sheet1[Group],
                                         Sheet1[DATES.jyear],
                                          "Total",SUM(Sheet1[amount]
                                   ),
                           FILTER(Sheet1,Sheet1[Group]="Tile")
                            )
return
                 tableSummerize
 
 
However,when I trying to using slicer and rewtire my dax to this : 
 
 
TTBL =
                 var tableSummerize=
                          CALCULATETABLE(
                                    SUMMARIZE(
                                         Sheet1,
                                         Sheet1[Group],
                                         Sheet1[DATES.jyear],
                                          "Total",SUM(Sheet1[amount]
                                   ),
                           FILTER(Sheet1,Sheet1[Group]=Selectedvalue(Sheet1[Group])
                            )
return
                 tableSummerize
 
then I select one specific Group name in slicer :  it returns NOTHING!!!!! 
 
could somebody explain for me why ?
 
 
1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @psfard85 

According to your dax you provide , Here are my understand for your question:

(1)If you use "New Table" to return a table , it cannot use the SELECTEDVALUE() function because  the filtering context of the slicer cannot be obtained in the new table. 

(2)If you define the table in a measure, if you filter the slicer, the current filter context is automatically modified back, and we don't need to modify the current filter context as shown.

For your needs, you can provide some trusted input and output sample data so that we can better help you.

 

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

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @psfard85 

According to your dax you provide , Here are my understand for your question:

(1)If you use "New Table" to return a table , it cannot use the SELECTEDVALUE() function because  the filtering context of the slicer cannot be obtained in the new table. 

(2)If you define the table in a measure, if you filter the slicer, the current filter context is automatically modified back, and we don't need to modify the current filter context as shown.

For your needs, you can provide some trusted input and output sample data so that we can better help you.

 

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

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.