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
Santanak
Regular Visitor

Roll over

Hi All,

 

Need help in below calculation as i am new to PBI.

 

C= B - 15000

D = d[n-1] + c[n]

 

  A              B               C                   D

monthDemandDemand - 15000Carry forward
Jan273421234212342
Feb7025-79754367
Mar305841558419951
Apr22044704426995
June11711-328923706
July261031110334809
Aug1526626635075
1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Santanak 

 

I assume that your month column is based on a date column add the following two measures:

 

v

Demand -15000 = SUM('Table'[Demand]) -15000

Carry forward =
SUMX (
    CALCULATETABLE (
        SUMMARIZE ( 'Table', 'Table'[month], "@Demand-15000", [Demand -15000] ),
        'Table'[month] <= MAX ( 'Table'[month] )
    ),
    [@Demand-15000]
)

MFelix_0-1634566960711.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
MFelix
Super User
Super User

Hi @Santanak 

 

I assume that your month column is based on a date column add the following two measures:

 

v

Demand -15000 = SUM('Table'[Demand]) -15000

Carry forward =
SUMX (
    CALCULATETABLE (
        SUMMARIZE ( 'Table', 'Table'[month], "@Demand-15000", [Demand -15000] ),
        'Table'[month] <= MAX ( 'Table'[month] )
    ),
    [@Demand-15000]
)

MFelix_0-1634566960711.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Thanks Felix for the solution. Just one more criteria, if carried forward is negative in previous row then it will not add.

Hi @Santanak,

 

You want that if for example you have

 

 

Demand -15000 Carried Forward Carried forward Expected
1000 1000 1000
-1500 -500 1000
500 0 1500

 

Is this what you mean?


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



if CF is -ve, then in next row 0 will be added .

monthDemandDemand - 15000Carry forward
Jan273421234212342
Feb7025-79754367
Mar305841558419951
Apr2204-127967155
June1171-13829-6674
July2610-123900
Aug15266266266

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.