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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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 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.