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
Guyakobov
Helper II
Helper II

Calculate column with subtract rows

HI,

 

I want to calculate the column and subtract the rows.

the columns are this http://prntscr.com/o8ldj1 

and it should be like this:  http://prntscr.com/o8lfm5

 

Thanks

 

 

 

 

1 ACCEPTED SOLUTION

Ok, this should work. It is a measure as well. Your title was a bit confusing as you asked for a calculate column.

 

FloatingStart = 
VAR SelectedYear = YEAR( SELECTEDVALUE( Table1[Start Date] ) )
VAR SelectedMonth = MONTH( SELECTEDVALUE( Table1[Start Date] ))
VAR FloatingStart =
    CALCULATE( 
        SUM( Table1[Floating Start] ),
        ALL( Table1 ),
        YEAR( Table1[Start Date] ) = SelectedYear,
        MONTH( Table1[Start Date] ) <= 13 - SelectedMonth
        )
RETURN
    FloatingStart

Example.jpg

 

View solution in original post

12 REPLIES 12

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.