The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi everyone,
I have a table in a report as per the screen below. One column for dates and one column for values.
I would need a representation of the data in a visual Matrix as shown in the screen below.
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
Solved! Go to Solution.
Hi @Z_BI
You can refer to the following sample, it return the value at different year but at the same month.
Sample data
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
Then put the year of the date table to the slicer.
Output
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.
Hi @Z_BI
You can refer to the following sample, it return the value at different year but at the same month.
Sample data
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
Then put the year of the date table to the slicer.
Output
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.