Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I am trying to create a Matrix that has columns for each date of the first week of the month and list sales by department. I want this to include any day of the first week that occurred in the previous month. For instance, for the month of May, the the matrix should have a column for each day between Monday 4/29 thru Sunday 5/5 (we start our week on Monday). The page has a Fiscal Year and Month slicer for users to interact with.
In the below on the first Matrix, I am not able to get 4/29 and 4/30 columns to display.
I am able to group them by week and return the correct total (second matrix) by using the below measure for the Sales data:
Weekly Sales =
CALCULATE(
[Gross Sales]
,DATESBETWEEN('Date'[Date],min('Date'[WeekStart]),max('Date'[WeekEnd]))
,All('Date'[Fiscalyear],'Date'[MonthName])
)
I cannot however figure out how to make the two April date columns appear on the top matrix. Any suggestion on how to acheive this?
Solved! Go to Solution.
Hi @dwelsh
You can refer to the following sample data.
Sample data
1.I create a calendar table and create a relationship among the table.
2.Create a measure.
MEASURE =
VAR a =
DATE ( MAX ( 'Calendar'[Year] ), MONTH ( MAX ( 'Calendar'[Date] ) ), 1 )
VAR b =
a - WEEKDAY ( a, 2 ) + 1
VAR c =
a + 7
- WEEKDAY ( a, 2 )
RETURN
CALCULATE ( SUM ( 'Table'[Value] ), DATESBETWEEN ( 'Calendar'[Date], b, c ) )
3.Put the following field to the matrix visual. the date column is belong to the data table not the calendar table.
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 @dwelsh
You can refer to the following sample data.
Sample data
1.I create a calendar table and create a relationship among the table.
2.Create a measure.
MEASURE =
VAR a =
DATE ( MAX ( 'Calendar'[Year] ), MONTH ( MAX ( 'Calendar'[Date] ) ), 1 )
VAR b =
a - WEEKDAY ( a, 2 ) + 1
VAR c =
a + 7
- WEEKDAY ( a, 2 )
RETURN
CALCULATE ( SUM ( 'Table'[Value] ), DATESBETWEEN ( 'Calendar'[Date], b, c ) )
3.Put the following field to the matrix visual. the date column is belong to the data table not the calendar table.
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.
This worked! Thank you so much for your help.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 64 | |
| 31 | |
| 29 | |
| 24 |