Forum Discussion

Sax's avatar
Sax
Helper I
3 years ago
Solved

Breakdown by quarter

Hi community,

I got a simple model with a fact table, a dimension table and a calendar

 

I'd like to achieve the breakdown by quarter within each year like in the table below:

How do you calculate the Measure on column 3?

Many thanks

 

Sax

  • I figured this out - the right measure to use is 

     

    QuarterBreakdown =
    VAR YearSales =
        SUMX (
            VALUES ( 'Calendar'[Year] ),
            CALCULATE ( [1. Total Sales], ALLSELECTED ( 'Calendar' ) )
        )
    RETURN
        DIVIDE ( [1. Total Sales], YearSales )

3 Replies

  • Syk's avatar
    Syk
    Resident Rockstar

    What do you want the measure in column 3 to show or do? 

  • Syk  show the value for each year repeated. Exactly how it is showed on the table. The idea is to use that column to calculate the breakdown within each year, also exactly how it is displayed on the table.

  • I figured this out - the right measure to use is 

     

    QuarterBreakdown =
    VAR YearSales =
        SUMX (
            VALUES ( 'Calendar'[Year] ),
            CALCULATE ( [1. Total Sales], ALLSELECTED ( 'Calendar' ) )
        )
    RETURN
        DIVIDE ( [1. Total Sales], YearSales )