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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Naveen_SV
Helper IV
Helper IV

How to write a Dax for after half year adding value based on 6th month

Hi Team,

 

I have a requirement first half of the year my cost will remain same, but later secound half of the year my cost should add 6th month cost.

 

Ex :       month           Cost

               1                   23

               2                   21

               3                  20

               4                  33

               5                  12

               6                   15

               7                  12+15

               8                   11+15

               9                   09+15

              10                 14+15

              11                  24+ 15

              12                 26+15

 

Above example is just a dummy  please let me know if this is possbile.

2 ACCEPTED SOLUTIONS

Hi Amit,

 

I tried with both like creating Measure and column also but i am getting same error.

 

new column =
VAR _cost =
MAXX ( FILTER ( 'Table', 'Table'[Month] = 6 ), 'Table'[Total Cost] )
RETURN
IF ( 'Table'[Month] > 6, _cost + 'Table'[Total Cost] )
 
with measure
new measure =
VAR _cost =
MAXX ( FILTER ( 'Table', 'Table'[Month] = 6 ), 'Table'[Total Cost] )
RETURN
IF ( FILTER ( 'Table', 'Table'[Month] = 6 ), _cost, 'Table'[Total Cost] )image.pngimage.png
 

View solution in original post

v-jingzhang
Community Support
Community Support

Hi @Naveen_SV 

 

Please create a new column with below code. PBIX is attached. 

new cost = 
IF (
    'Table'[Month] > 6,
    MAXX ( FILTER ( 'Table', 'Table'[Month] = 6 ), 'Table'[Cost] ) + 'Table'[Cost],
    'Table'[Cost]
)

vjingzhang_0-1645495276892.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

6 REPLIES 6
v-jingzhang
Community Support
Community Support

Hi @Naveen_SV 

 

Please create a new column with below code. PBIX is attached. 

new cost = 
IF (
    'Table'[Month] > 6,
    MAXX ( FILTER ( 'Table', 'Table'[Month] = 6 ), 'Table'[Cost] ) + 'Table'[Cost],
    'Table'[Cost]
)

vjingzhang_0-1645495276892.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Naveen_SV
Helper IV
Helper IV

Hi Amit,

 

Can you send me pbi file please it will help

amitchandak
Super User
Super User

@Naveen_SV , try new column like

 


new column =
var _cost = maxx(filter(Table, [Year] =earlier([Year]) && [Month] =6), [Cost])
return
if([Month] >6 , _cost + [Cost], [Cost])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

HI Amit,

thanks for your reply, i don't have this year column but i have only month in number, when i tried your

 

formuale i am getting this error pleas find the below table   image.png

 

image.png

 

 

<pi>A circular dependency was detected: Invoice[Running total].</pi>

@Naveen_SV , Try like

new column =
var _cost = maxx(filter(Table, [Month] =6), [Cost])
return
if([Month] >6 , _cost + [Cost], [Cost])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,

 

I tried with both like creating Measure and column also but i am getting same error.

 

new column =
VAR _cost =
MAXX ( FILTER ( 'Table', 'Table'[Month] = 6 ), 'Table'[Total Cost] )
RETURN
IF ( 'Table'[Month] > 6, _cost + 'Table'[Total Cost] )
 
with measure
new measure =
VAR _cost =
MAXX ( FILTER ( 'Table', 'Table'[Month] = 6 ), 'Table'[Total Cost] )
RETURN
IF ( FILTER ( 'Table', 'Table'[Month] = 6 ), _cost, 'Table'[Total Cost] )image.pngimage.png
 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.