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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.