Forum Discussion

stephank's avatar
stephank
Frequent Visitor
8 years ago
Solved

DAX field scoping

The problem is that under 'ProjectMart' Table I can select only previously defined measure and not other colums i.e [Cu Feature Points] that are within the 'ProjectMart' Table. Why is that? and How do I solve it. 

 

I have the following new measure code:

EV TEST2 =
VAR
CurrentSP = ProjectMart[Cu Feature Points]
RETURN
COUNTROWS (
FILTER (
ALL(ProjectMart[Cu Feauture Points]),
ProjectMart[Cu Feature Points] > CurrentSP
)
)

  • Hi stephank,

     

    In addition, the formula(without defining a new measure or variable) below should also work. :smileyhappy:

    EV TEST2 =
    COUNTROWS (
        FILTER (
            ALL ( ProjectMart[Cu Feature Points] ),
            ProjectMart[Cu Feature Points] > MAX ( ProjectMart[Cu Feature Points] )
        )
    )

    Note: You can replace the MAX function with any other aggregation functions(i.e. MIN or SUM), which should also work.

     

    Regards

2 Replies

  • popov's avatar
    popov
    Resolver III

    Hello,

    Try this formula:

     

    EV TEST2 :=
    VAR
    CurrentSP = MAX(ProjectMart[Cu Feature Points])
    RETURN
    COUNTROWS (
    FILTER (
    ALL(ProjectMart[Cu Feauture Points]),
    ProjectMart[Cu Feature Points] > CurrentSP
    )
    )

     

  • v-ljerr-msft's avatar
    v-ljerr-msft
    Microsoft Employee

    Hi stephank,

     

    In addition, the formula(without defining a new measure or variable) below should also work. :smileyhappy:

    EV TEST2 =
    COUNTROWS (
        FILTER (
            ALL ( ProjectMart[Cu Feature Points] ),
            ProjectMart[Cu Feature Points] > MAX ( ProjectMart[Cu Feature Points] )
        )
    )

    Note: You can replace the MAX function with any other aggregation functions(i.e. MIN or SUM), which should also work.

     

    Regards