Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Filtering one visual using a date from another visual

I'm doing reporting from Salesforce.

 

In my model I have Campaign and Opportunity.

 

Campaign has a start date and represents a marketing campaign.

 

Opportunity has a start date.

 

When I select a Campaign from a table, I want the table of Opportunities to filter on that Campaign, *IF* the start date of the opportunity is after the start date of the campaign.

  • Hi Anonymous,

    Please create a measure using the formula below and check if it works fine.

    Measure =
    IF (
        FIRSTNONBLANK ( opportunit[startdate], opportunit[startdate] )
            > SELECTEDVALUE ( Campaign[start date] ),
        "True",
        "Flase"
    )
    


    Please feel free to ask if you have any other issue.

    Best Regards,
    Angelia


3 Replies

  • Does these tables have relations? Can you share sample data in excel?

    • Anonymous's avatar
      Anonymous
      Not applicable

      The relations are working, when I click on a campaign I see all opportunities, the only issue is that that's all historical opportunities for the campaign attached to the account.

       

      I don't know how to get that data into Excel. If this were a database I'd make a table of CampaignID, OpportunityID, and a function that showed true if the campaign.startdata < opportunity.startdate but I don't know how to do that in PowerBI.

      • v-huizhn-msft's avatar
        v-huizhn-msft
        Microsoft Employee

        Hi Anonymous,

        Please create a measure using the formula below and check if it works fine.

        Measure =
        IF (
            FIRSTNONBLANK ( opportunit[startdate], opportunit[startdate] )
                > SELECTEDVALUE ( Campaign[start date] ),
            "True",
            "Flase"
        )
        


        Please feel free to ask if you have any other issue.

        Best Regards,
        Angelia