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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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

Top Solution Authors