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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
snaydeck
New Member

I need to calculate the growth or decrease based on the first and last record


I need to calculate the growth or decrease based on the first and last record.

 

I have no idea. Bring data from one column based on another. When I say this, it is because I understand that I should bring the "QTY" column based on MIN (vdata) and MAX (vdata) and this I am not able to do with the little knowledge I have.

 

namevdataqty
name a01/01/201710
name a10/10/201715
name a11/11/201720
name b02/02/201710
name b04/04/201714
name b05/05/20178
name c08/08/201710
name c09/09/201732
name c05/05/201742



----------------------------------

Example "Name A":

First reading: 01/01/2017
Value: 10

Last reading: 11/11/2017
Value: 20

-> Positive Result: 100%

----------------------------------

Example "Name B"

First reading: 02/02/2017
Value: 10

Last reading: 11/11/2017
Value: 8

-> Negative Result: (- 20%)

----------------------------------

In the past I simply calculated using MIN (qty) and MAX (qty). But sometimes between falls and uploads the data comes in incorrectly. GROWPERCENT = ((MAX(qty) - MIN(qty))/ MIN(qty)

I appreciate the help.

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi,

 

Use this measure

Growth :=
CALCULATE (
    VALUES ( Table1[qty] ),
    FILTER ( Table1, Table1[vdata] = MAX ( Table1[vdata] ) )
)
    / CALCULATE (
        VALUES ( Table1[qty] ),
        FILTER ( Table1, Table1[vdata] = MIN ( Table1[vdata] ) )
    )
    - 1

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

Hi,

 

Use this measure

Growth :=
CALCULATE (
    VALUES ( Table1[qty] ),
    FILTER ( Table1, Table1[vdata] = MAX ( Table1[vdata] ) )
)
    / CALCULATE (
        VALUES ( Table1[qty] ),
        FILTER ( Table1, Table1[vdata] = MIN ( Table1[vdata] ) )
    )
    - 1

Hi @Zubair_Muhammad thanks a lot.

 

I just tested and it worked perfectly!!

 

When the person has the knowledge, everything is easier, right?

 

Thank you very much.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.