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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
gaikwadaa123
Helper II
Helper II

percent change by rows

Hello, I need urgent help.

 

I have below table 

gaikwadaa123_0-1633994722711.png

I would like to calculate the percent change of the 'Value' column for each Hour. 

So that 0 hour will have 0 as percent change  always and it will start from 0-1, 1-2,2-3 hour so on... till 23 hour and for each MeasureDate-copy and each MeasurementName 

Also please consider 'MeasureDate-copy' column and MeasurementName like (various Prducts), so that for each measurementname formula will calculate the percentage change from hour 0 to 23 for that sepecific day only. and so on. 

 

Pleas help me by using my column names. I really appriate any assistsnace. 

1 ACCEPTED SOLUTION

Hi @gaikwadaa123 ,

 

Please create it as a calculated measure, not a calculated column.

 

If you want to create a calculated column, try this:

 

Column =
Table[Diff]
    - CALCULATE (
        SUM ( Table[Diff] ),
        FILTER (
            Table,
            Table[MeasurementName] = EARLIER ( Table[MeasurementName] )
                && Table[Date] = EARLIER ( Table[Date] )
                && Table[hour]
                    = EARLIER ( Table[hour] ) - 1
        )
    )

 

 

Best Regards,

Icey

 

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

6 REPLIES 6
amitchandak
Super User
Super User

@gaikwadaa123 , Try a new measure like

 

sum(Table[Diff])- calculate(sum(Table[Diff]), filter(Table, Table[Date] = max(Table[Date]) && Table[hour] = max(Table[hour]]) -1 ))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I am looking for the precentage change which should include devide statement. With your formula i can see result like below 

 

gaikwadaa123_0-1634041785875.png

It is calculating same result for all rows. I want to see the percentage change for value column by each hour. 

Can you modify and check ?

 

 

Hi @gaikwadaa123 ,

 

Please create it as a calculated measure, not a calculated column.

 

If you want to create a calculated column, try this:

 

Column =
Table[Diff]
    - CALCULATE (
        SUM ( Table[Diff] ),
        FILTER (
            Table,
            Table[MeasurementName] = EARLIER ( Table[MeasurementName] )
                && Table[Date] = EARLIER ( Table[Date] )
                && Table[hour]
                    = EARLIER ( Table[hour] ) - 1
        )
    )

 

 

Best Regards,

Icey

 

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

Icey
Community Support
Community Support

Hi @gaikwadaa123 ,

 

Can this work?

 

Best Regards,

Icey

 Power Bi Screenshot.PNGthank you it worked. I am looking for another same issue, 

 

I have two tables Difference and history ,

I would like to calculate the difference between Difference(actual) and History(value) colums based on the Hours and rate area. 

Here is the screenshot:

 

Did you check my reply?

 Can you help me?

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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