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

Filter data using the value of a filtered table

Hello everyone,

 

I am using a measure to find the total value of a column based on the value specified.

 

For example,

Total = CALCULATE(SUM('Word TimeSeries'[GSC_Combined_Impressions]), FIND("dahlia", 'Word Snapshot'[Word],1,0)>0)


However, I have 50 product categories for which I want to make the same calculation. So instead of creating 50 measures like the above, is it possible to use a table that will contain all the terms eg dahlia and when that table is filtered using a slicer to use the first value of the column as a value for the FIND formula?

 

So the measure might look like

 

Total = CALCULATE(SUM('Word TimeSeries'[GSC_Combined_Impressions]), FIND([FilteredColumnName], 'Word Snapshot'[Word],1,0)>0)

Any ideas on how this can be achieved?

Hope the above makes sense.

Thank you in advance

George

 

1 ACCEPTED SOLUTION

@Anonymous,

 

You can add product categories to a slicer, and then pass the selected item value to your FIND function.

Measure =
var selectedvalue = IF(HASONEFILTER('Product'[Product]),LASTNONBLANK('Product'[Product],1),BLANK())
return CALCULATE(SUM(Sales[Sales]),FIND(selectedvalue,Sales[Product],1,0)>0)

Capture.PNGCapture1.PNG

 

Regards,

Charlie Liao

 

View solution in original post

4 REPLIES 4
vik0810
Resolver V
Resolver V

Use FIRSTNONBLANK Function.

 

Total = CALCULATE(SUM('Word TimeSeries'[GSC_Combined_Impressions]), FIND(FIRSTNONBLANK(table[column], ""), 'Word Snapshot'[Word],1,0)>0)
Anonymous
Not applicable

Hello @vik0810

 

Thank you for your reply.

 

I tried this approach before, but unfortunately, it returns an error. The syntax is not correct because the FIRSTNONBLANK is used in a True/False expression that is used as a table filter expression and it is not allowed.

Thank you for your prompt reply and really appreciate your help.

Regards

George

 

 

@Anonymous,

 

You can add product categories to a slicer, and then pass the selected item value to your FIND function.

Measure =
var selectedvalue = IF(HASONEFILTER('Product'[Product]),LASTNONBLANK('Product'[Product],1),BLANK())
return CALCULATE(SUM(Sales[Sales]),FIND(selectedvalue,Sales[Product],1,0)>0)

Capture.PNGCapture1.PNG

 

Regards,

Charlie Liao

 

Anonymous
Not applicable

@v-caliao-msft

Hello Charlie,

 

Thank you so much! This is exactly what I needed.

I need to start working more with variables.

 

Thank you!

Regards
George

 

 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.