Forum Discussion

sp_nokia_nz's avatar
sp_nokia_nz
Frequent Visitor
6 years ago
Solved

extracting first and last entries between dates

I want to achieve the following and wondering if it is even possible with power BI

There is a database that maintains all the historic changes to various servers in the network.

I want to be able to generate a report that gives me an the from and to value for a server change between a given period. Eg Refer the table below:

 

Server_namedate of changeoriginal valuenew value
server_104-10-2019change_1change_2
server_104-12-2019change_2change_3
server_104-1-2020change_3change_4
server_104-2-2020change_4change_5

 

If I want to see the change on server_1 in the last 4 months (or a between two dates using a filter option),  the result must be:

 

Server_nameoriginal valuenew value
server_1change_1change_5

 

Is this possible with any of the formula in power BI?

 

 

 

  • Hi sp_nokia_nz ,

     

    Please check if this is what you want:

     

    Create measures like so:

    Original Value Measure = 
    CALCULATE (
        MIN ( 'Table'[original value] ),
        FILTER ( 'Table', 'Table'[date of change] = MIN ( 'Table'[date of change] ) )
    )
    
    New Value Measure = 
    CALCULATE (
        MAX ( 'Table'[new value] ),
        FILTER ( 'Table', 'Table'[date of change] = MAX ( 'Table'[date of change] ) )
    )
    

     

     

    Best Regards,

    Icey

     

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

1 Reply

  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi sp_nokia_nz ,

     

    Please check if this is what you want:

     

    Create measures like so:

    Original Value Measure = 
    CALCULATE (
        MIN ( 'Table'[original value] ),
        FILTER ( 'Table', 'Table'[date of change] = MIN ( 'Table'[date of change] ) )
    )
    
    New Value Measure = 
    CALCULATE (
        MAX ( 'Table'[new value] ),
        FILTER ( 'Table', 'Table'[date of change] = MAX ( 'Table'[date of change] ) )
    )
    

     

     

    Best Regards,

    Icey

     

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