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
Anonymous
Not applicable

Filtering a SWITCH Measure within EVALUATE

Hi All, 

 

I have switch measure which I would like to run a trace on within DAX Studio. It is a typical switch measure which uses a filter from an unrelated lookup table - MeasuresTable. 

 

How do I apply a filter to an evaluate statement when the measures table is a unrelated table? Currently it is returning a table of multiple values rather than a single value (as you would expect).

 

Currently the EVALUATE statement looks something like this:

 

EVALUATE
    SUMMARIZE(
    'FactTable',
    'dimDate'[Month],
    "Value", [SwitchMeasure1],
)

 

 

FILTER(MeasureTable, 'MeasureTable'[MeasureName] = "The Measure I Want") <--- Where do I put this!
    

1 REPLY 1
v-yuezhe-msft
Employee
Employee

@Anonymous,

Could you please share sample data of your tables and post expected result here?

You can add CALCULATE() function to return filtered data inside the SUMMARIZED function following the instructions in the blog below. 

http://www.sqlbi.com/articles/best-practices-using-summarize-and-addcolumns/

However, if you want to return single value instead of table, you may need to create measure or calculated column instead of summarized table.

Regards,

Community Support Team _ Lydia 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.