Forum Discussion

BarryWhitelaw's avatar
BarryWhitelaw
Regular Visitor
11 months ago
Solved

Add Row Showing % of Current Column

I'm writing a visualization that shows Months, Region and Spend.  I need a row underneath each month that shows the % of spend against the total.   When I add a New Visual Calculation it adds this ...
  • MasonMA's avatar
    MasonMA
    11 months ago

    Hi,

     

    Your 'Sum of Total' is aggregated by Power BI automatically. You will need to make a few Explicit Measures by creating 'New Measures', in your case they would be 

    Total = SUM('Vlookup - Exact'[Total])

     

    Total Spend =
    CALCULATE (
    [Total],
    ALL ( 'Vlookup - Exact'[Region] ), ALL ( 'Vlookup - Exact'[Month] )
    )

     

    % of Spend Grand Total =
    IF (

    HASONEVALUE( 'Vlookup - Exact'[Region] ),
    BLANK(),
    DIVIDE ( [Total], [Total Spend] )
    )

     

    For the rest of steps, use 'Total' and '% of Spend Grand Total' Measures for your 'Values' in Matrix visual.