Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
aashudream
Regular Visitor

Months and Quarters side by side

I would like to see Months and Quarters side by side and not have to drill down in the visual.. any suggestion?

 

Month and values changed as per selection for last 12 month.

 

aashudream_0-1651945223472.jpeg

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @aashudream ,

According to your description, if the data you showed above is a matrix, Indicates that in the date column, all dates are in the same column as the quarters, this requires create a new table.

vkalyjmsft_0-1652339067871.png

Table 2 = UNION(VALUES('Table'[Date]),{"Q1","Q2","Q3","Q4"})

Then create three measures.

GSV =
VAR _A =
    MAXX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Global category] = MAX ( 'Table'[Global category] )
                && FORMAT ( 'Table'[Date], "M/D/YYYY" ) = MAX ( 'Table 2'[Date] )
        ),
        'Table'[GSV]
    )
RETURN
    SWITCH (
        MAX ( 'Table 2'[Date] ),
        "Q1",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q1"
                ),
                'Table'[GSV]
            ),
        "Q2",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q2"
                ),
                'Table'[GSV]
            ),
        "Q3",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q3"
                ),
                'Table'[GSV]
            ),
        "Q4",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q1"
                ),
                'Table'[GSV]
            ),
        _A
    )
Net Sales =
VAR _A =
    MAXX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Global category] = MAX ( 'Table'[Global category] )
                && FORMAT ( 'Table'[Date], "M/D/YYYY" ) = MAX ( 'Table 2'[Date] )
        ),
        'Table'[Net Sales]
    )
RETURN
    SWITCH (
        MAX ( 'Table 2'[Date] ),
        "Q1",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q1"
                ),
                'Table'[Net Sales]
            ),
        "Q2",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q2"
                ),
                'Table'[Net Sales]
            ),
        "Q3",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q3"
                ),
                'Table'[Net Sales]
            ),
        "Q4",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q1"
                ),
                'Table'[Net Sales]
            ),
        _A
    )
Gross Profit =
VAR _A =
    MAXX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Global category] = MAX ( 'Table'[Global category] )
                && FORMAT ( 'Table'[Date], "M/D/YYYY" ) = MAX ( 'Table 2'[Date] )
        ),
        'Table'[Gross Profit]
    )
RETURN
    SWITCH (
        MAX ( 'Table 2'[Date] ),
        "Q1",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q1"
                ),
                'Table'[Gross Profit]
            ),
        "Q2",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q2"
                ),
                'Table'[Gross Profit]
            ),
        "Q3",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q3"
                ),
                'Table'[Gross Profit]
            ),
        "Q4",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q1"
                ),
                'Table'[Gross Profit]
            ),
        _A
    )

Get the correct result.

vkalyjmsft_1-1652339367480.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

View solution in original post

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @aashudream ,

According to your description, if the data you showed above is a matrix, Indicates that in the date column, all dates are in the same column as the quarters, this requires create a new table.

vkalyjmsft_0-1652339067871.png

Table 2 = UNION(VALUES('Table'[Date]),{"Q1","Q2","Q3","Q4"})

Then create three measures.

GSV =
VAR _A =
    MAXX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Global category] = MAX ( 'Table'[Global category] )
                && FORMAT ( 'Table'[Date], "M/D/YYYY" ) = MAX ( 'Table 2'[Date] )
        ),
        'Table'[GSV]
    )
RETURN
    SWITCH (
        MAX ( 'Table 2'[Date] ),
        "Q1",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q1"
                ),
                'Table'[GSV]
            ),
        "Q2",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q2"
                ),
                'Table'[GSV]
            ),
        "Q3",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q3"
                ),
                'Table'[GSV]
            ),
        "Q4",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q1"
                ),
                'Table'[GSV]
            ),
        _A
    )
Net Sales =
VAR _A =
    MAXX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Global category] = MAX ( 'Table'[Global category] )
                && FORMAT ( 'Table'[Date], "M/D/YYYY" ) = MAX ( 'Table 2'[Date] )
        ),
        'Table'[Net Sales]
    )
RETURN
    SWITCH (
        MAX ( 'Table 2'[Date] ),
        "Q1",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q1"
                ),
                'Table'[Net Sales]
            ),
        "Q2",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q2"
                ),
                'Table'[Net Sales]
            ),
        "Q3",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q3"
                ),
                'Table'[Net Sales]
            ),
        "Q4",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q1"
                ),
                'Table'[Net Sales]
            ),
        _A
    )
Gross Profit =
VAR _A =
    MAXX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Global category] = MAX ( 'Table'[Global category] )
                && FORMAT ( 'Table'[Date], "M/D/YYYY" ) = MAX ( 'Table 2'[Date] )
        ),
        'Table'[Gross Profit]
    )
RETURN
    SWITCH (
        MAX ( 'Table 2'[Date] ),
        "Q1",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q1"
                ),
                'Table'[Gross Profit]
            ),
        "Q2",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q2"
                ),
                'Table'[Gross Profit]
            ),
        "Q3",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q3"
                ),
                'Table'[Gross Profit]
            ),
        "Q4",
            SUMX (
                FILTER (
                    ALL ( 'Table' ),
                    'Table'[Global category] = MAX ( 'Table'[Global category] )
                        && 'Table'[Quarter] = "Q1"
                ),
                'Table'[Gross Profit]
            ),
        _A
    )

Get the correct result.

vkalyjmsft_1-1652339367480.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

TheoC
Super User
Super User

Hi @aashudream 

 

If you want to have Months and then Quarters as per the table you've presented, you have a few options, all of which will likely require a little bit of work:

  • You can set up your source data to be structured in the format you want.  Repeatability might be an issue if you are extracting raw data out of a system.
  • You can set up the structure you want in Power Query using the source data.
  • You can set up the structure you want in canvas view using dax measures for the Current Month, Last Month, etc., back to 12 months and repeat the same process for the Quarterly periods.  Then you can add these in order into your values on the Matrix.

I am not sure that there are other ways. There might be but to the best of my knowledge, I am not aware of any.  Note, if you are intending on doing this with various components of your data (e.g. you may want to work out Net Assets, Gross Profit, Net Profit, etc...) I recommend using Calculation Groups (https://docs.microsoft.com/en-us/analysis-services/tabular-models/calculation-groups?view=asallprodu...) as you will only need to do this once rather than doing it for each item.

 

Hope this makes sense! Let me know if you have any questions.


Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.