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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors