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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
mjpollock
New Member

Conditional formula based on certain months

Hi,

I'm very new to Power BI and need help adjusting a measure. I'm working with summarized end-of-month data. So far I have this:

 

Net Worth =

DIVIDE(

    'BGLCOAF'[Reserves],

    'BGLCOAF'[Total Assets],

    0

)

 

However, [Net Worth] only calculates correctly for March, June, September, and December because every other month's calculation should include a third variable "Net Income". For example:

 

For January's calculation = ([Reserves] + [January Net Income]) / [Total Assets]

For February = ([Reserves] + [January Net Income] + [February Net Income]) / [Total Assets]

For March = [Reserves] / [Total Assets]

And the same pattern for each quarter

 

I feel like something can be accomplished with conditional functions, but I also think I need to incorporate time or time-intelligence functions and I'm pretty unfamiliar with those.

 

I appreciate any help!

1 REPLY 1
v-rzhou-msft
Community Support
Community Support

Hi @mjpollock ,

 

I think your code should look like as below.

Net Worth with Condition =
IF (
    'BGLCOAF'[Month] IN { "March", "July", "September", "December" },
    DIVIDE ( 'BGLCOAF'[Reserves], 'BGLCOAF'[Total Assets], 0 ),
    DIVIDE ( 'BGLCOAF'[Reserves] + [Net Income], 'BGLCOAF'[Total Assets], 0 )
)

 

Best Regards,
Rico Zhou

 

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

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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