Forum Discussion

David_1970's avatar
David_1970
Frequent Visitor
9 years ago
Solved

Creating measure

Hi,   The table below show gross revenue and disbursement for a lot of projects (only one shown though).  On my report canvas I want a slicer where I can toggle between Gross Revenue and Net Revenu...
  • v-yulgu-msft's avatar
    9 years ago

    Hi David_1970,

     

    You need an extra table which contains only one column that will be added into slicer later. 

     

    Create measures as below:

    Gross Revenue =
    CALCULATE (
        SUM ( 'revenue  table'[Amount] ),
        'revenue  table'[Type] = "Gross Revenue"
    )
    
    Net Revenue =
    SUM ( 'revenue  table'[Amount] )

    Revenue =
    IF (
        LASTNONBLANK ( 'Slicer table'[Revenue Type], 1 ) = "Gross Revenue",
        [Gross Revenue],
        [Net Revenue]
    )