Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Percentage Difference between cards

Hello, I am having trouble creating a measure that would display the percentage difference between two cards I have. Both cards are of the same aggregated fact, but one of the cards is filtered by a ...
  • MFelix's avatar
    8 years ago

    Hi Anonymous,

     

    Assuming that you have the value from the slicer is based on the column Manufacturer try to change your measure to the one below the bold part of the measure is what is different:

    Count of BlockId % difference from Corporation =
    VAR __BASELINE_VALUE =
        CALCULATE(
            DISTINCTCOUNT('Data'[BlockId]),
              ALLSELECTED(   'Data'[Manufacturer] )
    )
    VAR __MEASURE_VALUE = DISTINCTCOUNT('Data'[BlockId])
    RETURN
        IF(
            NOT ISBLANK(__MEASURE_VALUE),
                  DIVIDE(__BASELINE_VALUE, __MEASURE_VALUE)
    )

    Regards,

    MFelix