Forum Discussion

powerbiwork's avatar
powerbiwork
Helper I
5 years ago
Solved

Calculated Column/Measure based on Filter

Hi,    I needed to create a measure/column that can take a field in opportunity object from SalesForce and multiply based on a filter slicer. For example, I need to multiply opportunity services am...
  • v-easonf-msft's avatar
    5 years ago

    Hi, powerbiwork 

    The filters works on the table visual, so there is no need to create an additional virtual table "myFilteredTable" in your measure "Division Factor".

     

    It is recommended to calculate in two steps.
    Step1: calculate the factor as below first.

    Factor =
    SWITCH (
        SELECTEDVALUE ( Opportunity[Commit_Upside__c] ),
        "Booked", SUM ( '2021 Assumptions'[Booked%] ),
        "Commit", SUM ( '2021 Assumptions'[Commit%] ),
        "Upside", SUM ( '2021 Assumptions'[Upside%] ),
        "Potential", SUM ( '2021 Assumptions'[Potebtial%] ),
        "Pipeline", SUM ( '2021 Assumptions'[Pipeline%] )
    )
    

    Step 2: Column "Opportunity'[Positive_Services_Amount__c USD])"  multiplied by factor “Factor”

     

    Value = SUM(Opportunity[ToUSD-Positive_Services_Amount])* [Division Factor]

     

     

     

    Please check my sample file for more details.

     

    Best Regards,
    Community Support Team _ Eason
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.