Filter from multiple tables

Hi all,

I am wondering if this is the correct Dax syntax if I wanted to filter two tables based on specific criteria. I am trying to learn Dax. I am from an excel world and Dax is somewhat new to me.

Thank you.

image

Hello,

I believe the Measure should read:

Total RFP =
CALCULATE(
SUM( ‘PPD Merged Tbl’[RFP Amount] ),
FILTER(
‘PPD Merged Tbl’,
‘PPD Merged Tbl’[Positive Days] = “Yes” &&
‘PPD Merged Tbl’[SFDC Campaign Names] <> BLANK()
)

Thanks rktoff but I made a mistake. I am trying to filter from two different tables. The example I gave you is from the same table.

Total RFP =
Calculate(
SUM(‘PPD Merged Tbl’[RFP Amount]),
FILTER(‘PPD Merged Tbl’,
‘PPD Merged Tbl’[Positive Days]=“Yes”),
Filter(
‘PPD Merged Campaigns’,
‘PPD Merged Campaigns’[Campaign Name]<>blank()
)

Is the above correct? It seems to work. Is there more efficient way to write this formula.

Just curious.

Ah, yes. I see you mentioned 2 tables now.

And yes, I do believe your Measure is correct.

(You can add as many filters as you want in the CALCULATE function)

The only other “efficiencies” you could implement would be using variables. But I don’t really see a need for it in this measure.

Now when I do it. It shows blank. I have attached a working file. What am I doing wrong.

WIP - Campaign.pbix (3.1 MB)

The column ‘Positive Days’ only has values of “Use” or “Do Not Use”

This should work for you

2 Likes

Thanks and it worked like a charm. I appreciate it.

1 Like