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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
luispadillazumb
Regular Visitor

Sum values from different Time variables.

Hello, i have several meassures that give me some data and i use them to calculate SLA in terms of:

 

Requirement (transactions) - production (what we can handle) = requirement (100% or less / how many transactions are left.

 

As you can see below we have Forecast Final (FC FF) - Prod = Txns OFF SLA

luispadillazumb_0-1619566339597.png

 

But now in order to have as realistis SLA as possible, i need to add the transactions left to the FF for the following hour. I tried to create a rolling sum but it just continues adding up until the end.

 

So: FC FF + (Trxns OFF SLA from previous hour) - Prod = Actual Trxns OFF SLA

 

and so on with all hours.

 

Is this possible?

 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @luispadillazumb ,

You can create a measure as below to get Actual Trxns OFF SLA:

Actual Trxns OFF SLA = 
VAR _curtime =
    SELECTEDVALUE ( 'Requirement'[data Time] )
VAR _pretime =
    CALCULATE (
        MAX ( 'Requirement'[data Time] ),
        FILTER ( ALLSELECTED ( 'Requirement' ), 'Requirement'[data Time] < _curtime )
    )
VAR _preTxnSLA =
    CALCULATE (
        [Txns OFF SLA],
        FILTER ( ALLSELECTED ( 'Requirement' ), 'Requirement'[data Time] = _pretime )
    )
RETURN
    IF ( ISBLANK ( _preTxnSLA ), BLANK (), [FC FF] + _preTxnSLA - [Prod] )

yingyinr_0-1619765303544.png

Best Regards

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

View solution in original post

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi @luispadillazumb ,

You can create a measure as below to get Actual Trxns OFF SLA:

Actual Trxns OFF SLA = 
VAR _curtime =
    SELECTEDVALUE ( 'Requirement'[data Time] )
VAR _pretime =
    CALCULATE (
        MAX ( 'Requirement'[data Time] ),
        FILTER ( ALLSELECTED ( 'Requirement' ), 'Requirement'[data Time] < _curtime )
    )
VAR _preTxnSLA =
    CALCULATE (
        [Txns OFF SLA],
        FILTER ( ALLSELECTED ( 'Requirement' ), 'Requirement'[data Time] = _pretime )
    )
RETURN
    IF ( ISBLANK ( _preTxnSLA ), BLANK (), [FC FF] + _preTxnSLA - [Prod] )

yingyinr_0-1619765303544.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ryan_mayu
Super User
Super User

@luispadillazumb 

could you please provide some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




amitchandak
Super User
Super User

@luispadillazumb , Assuming you have a measure [Trxns OFF SLA]. You need to try

 

calculate([Trxns OFF SLA], filter(all(Table) , Table[Datetime] = max(Table[Datetime]) -time(1,0,0)))

Hi @amitchandak, thank you so much for your support, but some values are missing (in blue):

 

luispadillazumb_0-1619599311955.png

Have any idea why?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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