Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
jpinciak
Regular Visitor

Sales Pipeline: Filter multiple columns

Hello,

 

I have a pretty standard dataset from salesforce that I am using slicers to define the selection in my dashboard between a beginning and end pipeline date (from data below). Based on those selections I am looking to determine the total of the amount column that had a probability in the beginning pipeline but in the end pipeline is 0.

 

Example:

Start Pipeline - 4/1/2022

End Pipeline - 5/1/2022

 

Looking at the opportunity ID's determine if on 4/1/2022 probability > 0 and then 5/1/2022 = 0 and then taking the amount from 5/1/2022

 

 

 

 

Pipeline DateProbability (%)Opportunity IDAmount
5/1/2022500066e00001dT8M9       25,000
5/1/2022250065A00001dSdNS       25,000
5/1/2022250065A00001dRpzu       25,000
5/1/202200065A00001dQsJl       25,000
4/1/2022250066e00001dT8M9       25,000
4/1/2022250065A00001dSdNS       25,000
4/1/2022250065A00001dRpzu       25,000
4/1/2022250065A00001dQsJl       25,000
7 REPLIES 7
jpinciak
Regular Visitor

ave been using this to try to calculate the change between two dates and it doesn't appear to get the right number

 

SUMX(
VALUES(HistSalesPipeline[Opportunity ID])
,VAR vFirstDate =FIRSTDATE(HistSalesPipeline[Pipeline Date])
 
VAR vLastDate =LAstdate(HistSalesPipeline[Pipeline Date])
VAR vProbAtFirstDate =
CALCULATE (
max ( HistSalesPipeline[Unweighted ARR] ),
FILTER (
ALLSELECTED ( HistSalesPipeline ),
HistSalesPipeline[Pipeline Date] = vFirstDate && HistSalesPipeline[Opportunity ID]=earlier(HistSalesPipeline[Opportunity ID]) && HistSalesPipeline[StageStatus]="Open"
)
)

VAR vProbAtLastDate =
CALCULATE (
max ( HistSalesPipeline[Unweighted ARR] ),
FILTER (
ALLSELECTED ( HistSalesPipeline ),
HistSalesPipeline[Pipeline Date] = vLastDate && HistSalesPipeline[Opportunity ID]=earlier(HistSalesPipeline[Opportunity ID]) && HistSalesPipeline[StageStatus]="Open"
)
)
 
 
 
RETURN
IF(vProbAtFirstDate >0 && vProbAtLastDate >0 ,vProbAtLastDate- vProbAtFirstDate)
)


Anonymous
Not applicable

@jpinciak , did the measure that I posted on 30 June give you the correct results?

Anonymous
Not applicable

Hi  @jpinciak ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below:

New Amount =
VAR _selopp =
    SELECTEDVALUE ( 'Table'[Opportunity ID] )
VAR _startdate =
    CALCULATE (
        MIN ( 'Table'[Pipeline Date] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Opportunity ID] = _selopp )
    )
VAR _enddate =
    CALCULATE (
        MAX ( 'Table'[Pipeline Date] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Opportunity ID] = _selopp )
    )
VAR _mindaterate =
    CALCULATE (
        SUM ( 'Table'[Probability (%)] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Opportunity ID] = _selopp
                && 'Table'[Pipeline Date] = _startdate
        )
    )
VAR _maxdaterate =
    CALCULATE (
        SUM ( 'Table'[Probability (%)] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Opportunity ID] = _selopp
                && 'Table'[Pipeline Date] = _enddate
        )
    )
VAR _maxdateamt =
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Opportunity ID] = _selopp
                && 'Table'[Pipeline Date] = _enddate
        )
    )
RETURN
    IF ( _mindaterate > 0 && _maxdaterate = 0, _maxdateamt, BLANK () )

yingyinr_0-1657255836522.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

jpinciak
Regular Visitor

bump

jpinciak
Regular Visitor

bump this bad boy up, I know one of you should know this easily

jpinciak
Regular Visitor

This was my attempt that didnt seem to work

 

Var currcalcdate = [CalcDate]

Var currcalcdate2 = [CalcDate2]

VAR currCalc =


Sumx( values(HistSalesPipeline[Opportunity ID]),
IF(and(CALCULATE(SUM(HistSalesPipeline[Probability (%)]),filter(HistSalesPipeline, HistSalesPipeline[Pipeline Date] = currcalcdate2)) = 0, CALCULATE(SUM(HistSalesPipeline[Probability (%)]),filter(HistSalesPipeline, HistSalesPipeline[Pipeline Date] = currcalcdate)) > 0),CALCULATE(SUM(HistSalesPipeline[Unweighted ARR]), filter(VALUES(HistSalesPipeline[Pipeline Date]), HistSalesPipeline[Pipeline Date]=currcalcdate)),BLANK()))


RETURN
currCalc


Anonymous
Not applicable

@jpinciak , this measure should work, and hopefully be easy to understand.

 

 

Amount of Opportunities that dropped to 0% in selected date range = 
    SUMX(
        VALUES('YourTable'[Opportunity ID])
        ,VAR vFirstDate = FIRSTDATE('YourTable'[PipelineDate])
         
        VAR vLastDate = LASTDATE('YourTable'[PipelineDate])
        
        VAR vProbAtFirstDate = 
            CALCULATE(
                MAX('YourTable'[Probability (%)])
                , 'YourTable'[Pipeline Date] = vFirstDate
            )
        
        VAR vProbAtLastDate =
            CALCULATE(
                MAX('YourTable'[Probability (%)])
                , 'YourTable'[Pipeline Date] = vLastDate
            )

        VAR vAmountAtLastDate = 
            CALCULATE(
                MAX('YourTable'[Amount])
                , 'YourTable'[Pipeline Date] = vLastDate
            )
 
       RETURN
            IF(vProbAtFirstDate > 100 && vProbAtLastDate = 0, vAmountAtLastDate)
    )

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.