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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
lherbert501
Post Patron
Post Patron

Negative Growth with 0

Hi,

 

I have a scenario which is probably quite rare, but I need to have it covered in the if statement.

Where there was £0 Profit in the previous year, a product has made a loss on current reporting year.

 

lherbert501_0-1679669140043.png

 

Growth % =
switch( TRUE(),
                [Last YTD] = 0 && [Profit] > 0, 1.00,
                [Last YTD] = 0 && [Profit] < 0,  DIVIDE([YTD - LYTD],[Last YTD])
                ,0)

 

I'm struggling with where Last YTD is 0 and the following year is a negative. Ideally that would say -3.50% above in growth but as I'm dividing by zero its blank/0. 

 

Is this possible?

 

Thanks

 

 

3 REPLIES 3
lbendlin
Super User
Super User

Please read about the third argument of the DIVIDE function.

Hi @lbendlin ,

 

But even with an alternative result, it will return a value of etc 0.

 

I would want it to say -3.50% in the example above.

Then put that in there? Doesn't have to be 0.

Helpful resources

Announcements
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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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