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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
CJKPowerBI
Helper I
Helper I

formula in excel make it in PowerBi

Hello all,

 

i have the below formula in excel which basically checks today's date and if before this month 23rd day then it puts the 15th of this month, if todays date is more than 23rd of this month then it puts the 15th of the next month.

 

=IF(OR((($C2)="Option1"),(($C2)="Option2")),IF(DAY($E2

<=23,DATE(YEAR($E2),MONTH($E2)+1,15),EOMONTH($E2,1)+15),$E2)

 

how can i transform it to be used in a column or measure in Power BI?

 

thank you in advance

1 ACCEPTED SOLUTION

@CJKPowerBI 

Please try

Amount to be paid on =
IF (
    OR ( [Charge] = "Text 1", [Charge] = "Text 2" ),
    IF (
        DAY ( [Transcation Date] ) <= 23,
        DATE ( YEAR ( [Transcation Date] ), MONTH ( [Transcation Date] ) + 1, 15 ),
        EOMONTH ( [Transcation Date], 1 ) + 15
    ),
    [Transcation Date]
)

View solution in original post

7 REPLIES 7
tamerj1
Super User
Super User

Hi @CJKPowerBI 

Same formula should work just fine for a calculated column, just replace the cell references with column references. 

lukiz84
Memorable Member
Memorable Member

In a calculated column the syntax is the same, you just have to change 2 things:

 

$C2 must be the column in your table 

$E2 must be another column in your table (where you have the data)

 

My formula gives me an error after those modifications, can you have alook and maybe paste the formula for PowerBi here pls?

@CJKPowerBI 

Please paste your formula here in order to be able to amend. 


Below is the formula:

 

Amount to be paid on = IF(OR(([Charge]="Text 1"),([Charge]="Text 2")),IF(DAY([Transcation Date]<=23,DATE(YEAR([Transcation Date],MONTH([Transcation Date])+1,15),EOMONTH([Transcation Date],1)+15),[Transcation Date])

@CJKPowerBI 

Please try

Amount to be paid on =
IF (
    OR ( [Charge] = "Text 1", [Charge] = "Text 2" ),
    IF (
        DAY ( [Transcation Date] ) <= 23,
        DATE ( YEAR ( [Transcation Date] ), MONTH ( [Transcation Date] ) + 1, 15 ),
        EOMONTH ( [Transcation Date], 1 ) + 15
    ),
    [Transcation Date]
)

thank you @tamerj1  that worked great...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors