Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

The True/False expression does not specify a column. Each True/False expressions used as a table fil

Hi everyone,   I am looking for a solution to the error I'm facing below. I have tried created a New Measure with the following Formula. Can someone point me where I'm making a mistake please? I ha...
  • v-cazheng-msft's avatar
    4 years ago

    Hi Anonymous 

     

    Please try this measure instead.

    Trading Gap $ =

    VAR CurrentSales =

        SUM ( 'Store data'[Sales MAT] )

    VAR VarietalProducts =

        CALCULATE (

            COUNTA ( 'Store data'[PRODUCT_NAME] ),

            FILTER (

                ALLEXCEPT ( 'Store data', 'Store data'[STORE_CODE], 'Store data'[Varietal] ),

                CurrentSales > 0

            )

        )

    VAR VarietalProductsSales =

        CALCULATE (

            SUM ( 'Store data'[Sales MAT] ),

            ALLEXCEPT ( 'Store data', 'Store data'[STORE_CODE], 'Store data'[Varietal] )

        )

    VAR PartofVarietalProducts =

        DIVIDE ( 1, VarietalProducts )

    VAR PartofVarietalProductsSales =

        DIVIDE ( CurrentSales, VarietalProductsSales )

    VAR LocalIndex =

        DIVIDE ( PartofVarietalProductsSales, PartofVarietalProducts, 0 )

    VAR MedianIndex =

        CALCULATE (

            MEDIAN ( 'Store data'[Local Index] ),

            FILTER (

                ALLEXCEPT ( 'Store data', 'Store data'[PRODUCT_NAME] ),

                CurrentSales > 0

            )

        )

    VAR PotentialSales = MedianIndex * PartofVarietalProducts * VarietalProductsSales

    return

        CALCULATE (

            ( PotentialSales - CurrentSales ),

            FILTER ( 'Store data', CurrentSales > 0 )

        )

     

    Then use this measure to create a new measure, use this new measure to create visual.

    Sum_Trading Gap$ = SUMX('Store data','Store data'[Trading Gap $])

     

    Result looks like this:

    Attached the pbix file as reference.

     

    Best Regards,

    Community Support Team _ Caiyun

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have problems on it, please feel free to let us know. Thanks a lot!