Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
2 years ago
Solved

Framed Bar Chart

Does anyone know how to make this graph?

thank you.

  • 1. You will need a Date Table marked as Date in your datamodel. (you can use the code in Power query from here : Extended Date Table (Power Query M function) - Power Query / M Code Showcase - Enterprise DNA Forum

    2. You will need a Fact table that will contain a column with Dates and Values

    3. You will need the following measures:

    Total = SUM('Table'[Value])
    
    Last Total = 
    VAR _LastDate = CALCULATE(MAX('Dates'[Date]), ALL('Dates'))
    VAR _CurrentDate = MAX('Dates'[Date])
    VAR _Result = 
        CALCULATE(
            [Cumulative Sales],
            'Dates'[Date] = _LastDate
        )
    RETURN 
        IF(_CurrentDate = _LastDate, _Result, BLANK())
    
    
    Cumulative Sales = 
    CALCULATE (
       [Total],
        FILTER (
            ALL ( Dates[Date] ),
            Dates[Date] <= MAX ( ( Dates[Date] ) )
        )
    )
    
    Title = "YOY: "
    

    4. You will use a line and clustered column chart with the following structure:

    5. For the format of the graph:

    a. Remove X-axis title

    b. Change the column and line color

    c. Data Labels: Show for the serieis ON : Total & Last Total

    d. For Last Total, go to Values = Last Total, Detail = Title, Layout Multi-line

     

    The result is the following:

     

    If it answers your query, please mark my reply as the solution. Thanks!

     

3 Replies

  • Alex87's avatar
    Alex87
    Icon for Solution Sage rankSolution Sage

    1. You will need a Date Table marked as Date in your datamodel. (you can use the code in Power query from here : Extended Date Table (Power Query M function) - Power Query / M Code Showcase - Enterprise DNA Forum

    2. You will need a Fact table that will contain a column with Dates and Values

    3. You will need the following measures:

    Total = SUM('Table'[Value])
    
    Last Total = 
    VAR _LastDate = CALCULATE(MAX('Dates'[Date]), ALL('Dates'))
    VAR _CurrentDate = MAX('Dates'[Date])
    VAR _Result = 
        CALCULATE(
            [Cumulative Sales],
            'Dates'[Date] = _LastDate
        )
    RETURN 
        IF(_CurrentDate = _LastDate, _Result, BLANK())
    
    
    Cumulative Sales = 
    CALCULATE (
       [Total],
        FILTER (
            ALL ( Dates[Date] ),
            Dates[Date] <= MAX ( ( Dates[Date] ) )
        )
    )
    
    Title = "YOY: "
    

    4. You will use a line and clustered column chart with the following structure:

    5. For the format of the graph:

    a. Remove X-axis title

    b. Change the column and line color

    c. Data Labels: Show for the serieis ON : Total & Last Total

    d. For Last Total, go to Values = Last Total, Detail = Title, Layout Multi-line

     

    The result is the following:

     

    If it answers your query, please mark my reply as the solution. Thanks!

     

  • Alex87's avatar
    Alex87
    Icon for Solution Sage rankSolution Sage

    It looks like a "Line and clustered column chart" with values of column chart by quarter and the line using a DAX measure that calculates the cumulative values. The Y axus are in sync. Please provide data and I can re create the graph if needed.

  • Well, actually it's a graph that I found on a website and I liked it, I would like to know how to get there, at the moment I don't care about the data if it is invented.