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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Z_BI
Frequent Visitor

Compare 2 values with different period in the same row in visual matrix

Hi everyone,
I have a table in a report as per the screen below. One column for dates and one column for values.

Z_BI_0-1709587116473.png

I would need a representation of the data in a visual Matrix as shown in the screen below.

Z_BI_1-1709587684964.png

 

1 - In the row headers all the dates available to me from the table.

2 - In the first column the sum of the filtered values ​​for a given date filter (starting from year, month, week, day).

3 - In the second column the sum of the filtered values ​​for another date filter. My wish is that where, for example, I have selected different years but the same month, everything appears on the same row.

 

In other words, through two date filters I would like to have the possibility of seeing two different values ​​which will certainly have different years but the same month, week and day

Please help me

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Z_BI 

You can refer to the following sample, it return the value at different year but at the same month.

Sample data 

vxinruzhumsft_0-1709780297920.png

1.Create a date table, there is no relationship between tables.

 

Date1 = CALENDAR(DATE(2021,1,1),DATE(2023,12,31))

 

2.Creata a measure

 

MEASURE =
IF (
    ISFILTERED ( Date1[Date].[Year] ),
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Date].[Year]
                IN VALUES ( 'Date1'[Date].[Year] )
                    && MONTH ( 'Table'[Date] ) = MONTH ( SELECTEDVALUE ( 'Table'[Date] ) )
        )
    ),
    CALCULATE ( SUM ( 'Table'[Value] ) )
)

 

3.Then put the measure and the following field to the matrix visual

vxinruzhumsft_1-1709780446196.png

 

Then put the year of the date table to the slicer.

Output

vxinruzhumsft_2-1709780483971.png

 

Best Regards!

Yolo Zhu

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

1 REPLY 1
Anonymous
Not applicable

Hi @Z_BI 

You can refer to the following sample, it return the value at different year but at the same month.

Sample data 

vxinruzhumsft_0-1709780297920.png

1.Create a date table, there is no relationship between tables.

 

Date1 = CALENDAR(DATE(2021,1,1),DATE(2023,12,31))

 

2.Creata a measure

 

MEASURE =
IF (
    ISFILTERED ( Date1[Date].[Year] ),
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Date].[Year]
                IN VALUES ( 'Date1'[Date].[Year] )
                    && MONTH ( 'Table'[Date] ) = MONTH ( SELECTEDVALUE ( 'Table'[Date] ) )
        )
    ),
    CALCULATE ( SUM ( 'Table'[Value] ) )
)

 

3.Then put the measure and the following field to the matrix visual

vxinruzhumsft_1-1709780446196.png

 

Then put the year of the date table to the slicer.

Output

vxinruzhumsft_2-1709780483971.png

 

Best Regards!

Yolo Zhu

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors