Forum Discussion

MattGlover's avatar
MattGlover
New Member
6 years ago
Solved

Graphing two Quick Measures

I have a "Line and clustered column chart" visualization in which I am graphing two Quick Measures.  Code for the two measures are:   Total Revenues per Capita = DIVIDE(SUM('Master (2dot0)'[Total ...
  • v-joesh-msft's avatar
    v-joesh-msft
    6 years ago

    Hi MattGlover ,

    If you just want the data in the line graph to display correctly, you can try creating the following measure instead (1.3) Total Revenues per Capita YoY%:

    mearsure =
    IF (
        ISFILTERED ( 'Master (2dot0)'[LongYear] ),
        ERROR ( "Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column." ),
        VAR __PREV_YEAR =
            CALCULATE (
                'Master (2dot0)'[Total Revenues per Capita],
                FILTER ( 'Master (2dot0)', 'Master (2dot0)'[LongYear].[Year] = 2017 )
            )
        VAR __THIS_YEAR =
            CALCULATE (
                'Master (2dot0)'[Total Revenues per Capita],
                FILTER ( 'Master (2dot0)', 'Master (2dot0)'[LongYear].[Year] = 2018 )
            )
        RETURN
            DIVIDE ( __THIS_YEAR - __PREV_YEAR, __PREV_YEAR )

    Best Regards,

    Community Support Team _ Joey
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.