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
sks2701
Helper III
Helper III

Formula

Hi

Im trying to construct a formula for calculating the conversion ratio. So i have a data set containing three years data and also have their sales column. Can someone please help me. thank you

 

1 year conversion = Count of companies who had sales > 0 in the year after the product launched / Count of companies who had sales< 0 in the year before the product launched
o 2 year conversion = Count of companies who had sales > 0 in any of the 2 years after the product launched / Count of companies who had sales in the year before the product launched
o 3 year conversion = Count of companies who had sales > 0 in any of the 3 years after the product laucnhed / Count of companies who had sales < 0 in the year before the product launched

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @sks2701 ,

You can create measures like this:

1 year conversion =
VAR a =
    CALCULATE (
        COUNT ( 'Table'[Company] ),
        FILTER (
            'Table',
            'Table'[Sales] > 0
                && 'Table'[Have launched] = "Yes"
                && 'Table'[Year] = YEAR ( TODAY () )
        )
    )
VAR b =
    CALCULATE (
        COUNT ( 'Table'[Company] ),
        FILTER (
            'Table',
            'Table'[Sales] < 0
                && 'Table'[Have launched] = "No"
                && 'Table'[Year] = YEAR ( TODAY () )
        )
    )
RETURN
    a / b
2 year conversion =
VAR a =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Company] ),
        FILTER (
            'Table',
            'Table'[Sales] > 0
                && 'Table'[Have launched] = "Yes"
                && 'Table'[Year] <= YEAR ( TODAY () )
                && 'Table'[Year]
                    >= YEAR ( TODAY () ) - 1
        )
    )
VAR b =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Company] ),
        FILTER (
            'Table',
            'Table'[Sales] < 0
                && 'Table'[Have launched] = "No"
                && 'Table'[Year] = YEAR ( TODAY () )
        )
    )
RETURN
    a / b
3 year conversion =
VAR a =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Company] ),
        FILTER (
            'Table',
            'Table'[Sales] > 0
                && 'Table'[Have launched] = "Yes"
                && 'Table'[Year] <= YEAR ( TODAY () )
                && 'Table'[Year]
                    >= YEAR ( TODAY () ) - 2
        )
    )
VAR b =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Company] ),
        FILTER (
            'Table',
            'Table'[Sales] < 0
                && 'Table'[Have launched] = "No"
                && 'Table'[Year] = YEAR ( TODAY () )
        )
    )
RETURN
    a / b

1.png

 

Best Regards,
Community Support Team _ Yingjie Li
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

1 REPLY 1
v-yingjl
Community Support
Community Support

Hi @sks2701 ,

You can create measures like this:

1 year conversion =
VAR a =
    CALCULATE (
        COUNT ( 'Table'[Company] ),
        FILTER (
            'Table',
            'Table'[Sales] > 0
                && 'Table'[Have launched] = "Yes"
                && 'Table'[Year] = YEAR ( TODAY () )
        )
    )
VAR b =
    CALCULATE (
        COUNT ( 'Table'[Company] ),
        FILTER (
            'Table',
            'Table'[Sales] < 0
                && 'Table'[Have launched] = "No"
                && 'Table'[Year] = YEAR ( TODAY () )
        )
    )
RETURN
    a / b
2 year conversion =
VAR a =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Company] ),
        FILTER (
            'Table',
            'Table'[Sales] > 0
                && 'Table'[Have launched] = "Yes"
                && 'Table'[Year] <= YEAR ( TODAY () )
                && 'Table'[Year]
                    >= YEAR ( TODAY () ) - 1
        )
    )
VAR b =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Company] ),
        FILTER (
            'Table',
            'Table'[Sales] < 0
                && 'Table'[Have launched] = "No"
                && 'Table'[Year] = YEAR ( TODAY () )
        )
    )
RETURN
    a / b
3 year conversion =
VAR a =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Company] ),
        FILTER (
            'Table',
            'Table'[Sales] > 0
                && 'Table'[Have launched] = "Yes"
                && 'Table'[Year] <= YEAR ( TODAY () )
                && 'Table'[Year]
                    >= YEAR ( TODAY () ) - 2
        )
    )
VAR b =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Company] ),
        FILTER (
            'Table',
            'Table'[Sales] < 0
                && 'Table'[Have launched] = "No"
                && 'Table'[Year] = YEAR ( TODAY () )
        )
    )
RETURN
    a / b

1.png

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.