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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
PaulSB
Regular Visitor

DAX Formula Conditional on Fiscal Year

I have a Calendar table with Fiscal Year column.  I'm trying to write a DAX formula to add a value to a measure according to the Fiscal Year.

Cost = IF('Calendar'[Fiscal Year] = 2020, 'Fixed'[Basis] + 20, IF('Calendar'[Fiscal Year] = 2021, 'Fixed'[Basis] + 25,100)

How can I coorect this?

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @PaulSB 

 

If [Basis] is a measure. You can try the following methods.

Cost = 
IF (
    SELECTEDVALUE ( 'Calendar'[Fiscal Year] ) = 2020,
    'Fixed'[Basis] + 20,
    IF (
        SELECTEDVALUE ( 'Calendar'[Fiscal Year] ) = 2021,
        'Fixed'[Basis] + 25,
        100
    )
)

vzhangti_0-1662619473626.png

 

If [Basis] is a column. You can try the following methods.

Cost 2 = 
IF (
    SELECTEDVALUE ( 'Calendar'[Fiscal Year] ) = 2020,
    SUM('Fixed'[Basis 2]) + 20,
    IF (
        SELECTEDVALUE ( 'Calendar'[Fiscal Year] ) = 2021,
        SUM('Fixed'[Basis 2]) + 25,
        100
    )
)

vzhangti_1-1662619667696.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @PaulSB 

 

If [Basis] is a measure. You can try the following methods.

Cost = 
IF (
    SELECTEDVALUE ( 'Calendar'[Fiscal Year] ) = 2020,
    'Fixed'[Basis] + 20,
    IF (
        SELECTEDVALUE ( 'Calendar'[Fiscal Year] ) = 2021,
        'Fixed'[Basis] + 25,
        100
    )
)

vzhangti_0-1662619473626.png

 

If [Basis] is a column. You can try the following methods.

Cost 2 = 
IF (
    SELECTEDVALUE ( 'Calendar'[Fiscal Year] ) = 2020,
    SUM('Fixed'[Basis 2]) + 20,
    IF (
        SELECTEDVALUE ( 'Calendar'[Fiscal Year] ) = 2021,
        SUM('Fixed'[Basis 2]) + 25,
        100
    )
)

vzhangti_1-1662619667696.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank You Charlotte,  That does exactly what was required.

Regards,

Paul

Adescrit
Impactful Individual
Impactful Individual

Hi @PaulSB ,

 

Is [Basis] a measure or a column?

 

Are you receiving an error message, or an incorrect result?


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

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.