Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Grand total become false

Hi All,

For the following table below, how should I write in dax for making grand total become false, if they contain false. such as Accessories contains false and I want the grand total becoming false. 

 

  • Hi Anonymous 
    Please try to adjust the measure as follows

    NewMeasure =
    VAR T1 =
        ADDCOLUMNS (
            VALUES ( ProductCategory[ProductCategoryName] ),
            "@Flag",
                CALCULATE (
                    IF ( SUM ( InternetSales_USD[SalesAmoun_USD] ) > 200000, TRUE (), FALSE () )
                )
        )
    VAR T2 =
        SELECTCOLUMNS ( T1, "@@Flag", [@Flag] )
    RETURN
        IF ( FALSE () IN T2, FALSE (), TRUE () )
  • Hi,

    I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file.

    It is for creating a measure.

     

     

    True or false measure: =
    VAR _newtable =
        ADDCOLUMNS (
            SUMMARIZE ( InternetSales, Category[Category], 'Year'[Year] ),
            "@condition",
                IF (
                    CALCULATE ( SUM ( InternetSales[SalesAmount] ) ) > 200000,
                    TRUE (),
                    FALSE ()
                )
        )
    RETURN
        IF (
            COUNTROWS ( FILTER ( _newtable, [@condition] = FALSE () ) ) >= 1,
            FALSE (),
            TRUE ()
        )
    

     

2 Replies

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 
    Please try to adjust the measure as follows

    NewMeasure =
    VAR T1 =
        ADDCOLUMNS (
            VALUES ( ProductCategory[ProductCategoryName] ),
            "@Flag",
                CALCULATE (
                    IF ( SUM ( InternetSales_USD[SalesAmoun_USD] ) > 200000, TRUE (), FALSE () )
                )
        )
    VAR T2 =
        SELECTCOLUMNS ( T1, "@@Flag", [@Flag] )
    RETURN
        IF ( FALSE () IN T2, FALSE (), TRUE () )
  • Hi,

    I tried to create a sample pbix file like below.

    Please check the below picture and the attached pbix file.

    It is for creating a measure.

     

     

    True or false measure: =
    VAR _newtable =
        ADDCOLUMNS (
            SUMMARIZE ( InternetSales, Category[Category], 'Year'[Year] ),
            "@condition",
                IF (
                    CALCULATE ( SUM ( InternetSales[SalesAmount] ) ) > 200000,
                    TRUE (),
                    FALSE ()
                )
        )
    RETURN
        IF (
            COUNTROWS ( FILTER ( _newtable, [@condition] = FALSE () ) ) >= 1,
            FALSE (),
            TRUE ()
        )