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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
carrascojg
Frequent Visitor

Filter temporal table with filter value

Hi All,

How cam i filter a temporal table with a filter values:

For example:

I have this temporal table T_Temp and in screen i have a filter for Market (get values from Marketing table. Eg: EMEA, Americas, India, etc)

T_Temp =
FILTER(
CALCULATETABLE (
    SUMMARIZE(
        'Facility Cost'
        ,'Facility Cost'[City]
        , 'Facility Cost'[Market]
        , "Cost", SUM('Facility Cost'[Facilities Costs])
        )
    )
, 'Facility Cost'[City] <> ""
&& 'Facility Cost'[Market] =  VALUE FROM FILTER 
)
I only made this filter works on that table when i use a string values like "EMEA" as a "VALUE FROM FILTER", but when i use 
SELECTEDVALUE('Marketing'[Market]), it doesn't work.
Somebody can help with this?
Thanks!
1 ACCEPTED SOLUTION
v-linyulu-msft
Community Support
Community Support

Thanks for the reply from lbendlin , please allow me to provide another insight:

Hi, @carrascojg 

Based on your description, I suspect you might be testing the DAX you mentioned in a calculation table.

vlinyulumsft_0-1733470430250.png

However, currently, there is no DAX that can capture slicer values in a calculation table or calculated column.

 

Below are the screenshots of the relevant answers:

vlinyulumsft_1-1733470430251.png

vlinyulumsft_2-1733470476007.png

 

For more details, please refer to:

Solved: Using Slicer values in a calculated column - Microsoft Fabric Community
Solved: Calculated column based on slicer value - Microsoft Fabric Community
 

Therefore, I suggest using the DAX you intend to use in a measure:

1.Here is my sample data:

vlinyulumsft_3-1733470476008.png

2.This is my optimised test measure:

MEASURE =
VAR cc =
    FILTER (
        SUMMARIZE (
            'Facility Cost',
            'Facility Cost'[City],
            'Facility Cost'[Market],
            "Cost", SUM ( 'Facility Cost'[Facilities Costs] )
        ),
        'Facility Cost'[City] <> BLANK ()
            && 'Facility Cost'[Market] IN VALUES ( Marketing[Market] )
    )
RETURN
    SUMX ( cc, [Cost] )

3.The final result is as follows:

vlinyulumsft_4-1733470511093.png

Please find the attached pbix relevant to the case.

 
Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
 

Best Regards,

Leroy Lu

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

3 REPLIES 3
v-linyulu-msft
Community Support
Community Support

Thanks for the reply from lbendlin , please allow me to provide another insight:

Hi, @carrascojg 

Based on your description, I suspect you might be testing the DAX you mentioned in a calculation table.

vlinyulumsft_0-1733470430250.png

However, currently, there is no DAX that can capture slicer values in a calculation table or calculated column.

 

Below are the screenshots of the relevant answers:

vlinyulumsft_1-1733470430251.png

vlinyulumsft_2-1733470476007.png

 

For more details, please refer to:

Solved: Using Slicer values in a calculated column - Microsoft Fabric Community
Solved: Calculated column based on slicer value - Microsoft Fabric Community
 

Therefore, I suggest using the DAX you intend to use in a measure:

1.Here is my sample data:

vlinyulumsft_3-1733470476008.png

2.This is my optimised test measure:

MEASURE =
VAR cc =
    FILTER (
        SUMMARIZE (
            'Facility Cost',
            'Facility Cost'[City],
            'Facility Cost'[Market],
            "Cost", SUM ( 'Facility Cost'[Facilities Costs] )
        ),
        'Facility Cost'[City] <> BLANK ()
            && 'Facility Cost'[Market] IN VALUES ( Marketing[Market] )
    )
RETURN
    SUMX ( cc, [Cost] )

3.The final result is as follows:

vlinyulumsft_4-1733470511093.png

Please find the attached pbix relevant to the case.

 
Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
 

Best Regards,

Leroy Lu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you Leroy, excelent workaround.

lbendlin
Super User
Super User

Read about SUMMARIZECOLUMNS and TREATAS.  These are preferred over SUMMARIZE and FILTER.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.