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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply

Measure: Finding total of still open

Hi, 

 

A bit of a complicated one, I'm looking to create a measure where I calculate the total value of opportunities open in various different months. Something being "open" is classed as anytime between the "Brief received on" date and "Closed on" date. Opportunities could be open for a few months, and the below data is just a selection. I've left some mock data below as well as the expected outcome 

 

Data:

Opportunity NameBrief received onClosed onValue
Opportunity A04/04/202204/06/2022£20
Opportunity B11/05/202211/07/2022£30
Opportunity C02/05/202213/05/2022£10
Opportunity D17/04/202217/05/2022£20
Opportunity E06/06/2022still open£10
Opportunity F22/06/202226/06/2022£50
Opportunity G08/03/2022still open£30

 

And this is what I would like to see from that:

Month Total Value OpenWorkings (not needed by as reference)
April£70A (20) + D (20) + G (30)
May£110A (20) + B (30) + C (10) + D (20) + G (30)
June£140A (20) + B (30) + E (10) + F (50) + G (30)
July£70B (30) + E (10) + G (30)

 

I think the measure just needs to find the total when "open" and then I can split this out by month after that, but I'm struggling to work it all out!

 

Laura

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

 

Total Open Value =
VAR ReferenceDate =
    MAX ( 'Date'[Date] )
VAR Result =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        REMOVEFILTERS ( 'Date' ),
        'Table'[Brief received on] <= ReferenceDate
            && (
                'Table'[Closed on] > ReferenceDate
                    || ISBLANK ( 'Table'[Closed on] )
            )
    )
RETURN
    Result

 

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

Try

 

Total Open Value =
VAR ReferenceDate =
    MAX ( 'Date'[Date] )
VAR Result =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        REMOVEFILTERS ( 'Date' ),
        'Table'[Brief received on] <= ReferenceDate
            && (
                'Table'[Closed on] > ReferenceDate
                    || ISBLANK ( 'Table'[Closed on] )
            )
    )
RETURN
    Result

 

Hi,

 

This does look really close thank you! It does still seem to be having some issues though.

Please can I ask what 'Table'[ReferenceDate]' refers to? It doesn't seem to like that part of the formula. Should this reference the date table? 

 

Thanks,

Laura 

That's my mistake, it should be 'Table'[Closed on]. I have edited my post to reflect that.

yes that's it - thank you much!!!

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.