Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

adjusting quick measure

Im using quick measure and want to make a small adjustment instead of IN i want to choose the whole table.. 

 

how do i go about doing that ?

 

Count of BICUST difference from 1, 10, 1000, 10002, 10005, 10006, 10008, 10009, 1002, 1003, or 10034 =
VAR __BASELINE_VALUE =
    CALCULATE(
        DISTINCTCOUNT('VBISALES (2)'[BICUST]),
        'VBISALES (2)'[BIITEM] IN {
            "1",
            "10",
            "1000",
            "10002",
            "10005",
            "10006",
            "10008",
            "10009",
            "1002",
            "1003",
            "10034"
        }
    )
VAR __MEASURE_VALUE = DISTINCTCOUNT('VBISALES (2)'[BICUST])
RETURN
    IF(NOT ISBLANK(__MEASURE_VALUE), __MEASURE_VALUE - __BASELINE_VALUE)

4 Replies

  • samdthompson's avatar
    samdthompson
    Memorable Member

    Hello, try making this measure:

     

    DistinctBICUST=DISTINCTCOUNT('VBISALES (2)'[BICUST])

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      thanks for that suggestion, didnt work though. I remember trying that 

      • samdthompson's avatar
        samdthompson
        Memorable Member

        Are you able to describe whats not working about that? Its just the core part of the calculation without the filtering.

         

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI Anonymous,

    You can use all functions to extract the target table field values and compare them with your expressions:

    Count of BICUST difference From Table =
    VAR __BASELINE_VALUE =
        CALCULATE (
            DISTINCTCOUNT ( 'VBISALES (2)'[BICUST] ),
            'VBISALES (2)'[BIITEM] IN ALLSELECTED ( Table[Column] )
        )
    VAR __MEASURE_VALUE =
        DISTINCTCOUNT ( 'VBISALES (2)'[BICUST] )
    RETURN
        IF ( NOT ISBLANK ( __MEASURE_VALUE ), __MEASURE_VALUE - __BASELINE_VALUE )

    Regards,

    Xiaoxin Sheng