Forum Discussion
How to create a new table according the dates
Aidarbek ,
If you don't already have a date table, you can create one using DAX:
DateTable =
ADDCOLUMNS (
CALENDAR ( DATE ( 2024, 1, 1 ), DATE ( 2024, 12, 31 ) ),
"Year", YEAR ( [Date] ),
"Month", MONTH ( [Date] ),
"Day", DAY ( [Date] ),
"MonthName", FORMAT ( [Date], "MMMM" ),
"YearMonth", FORMAT ( [Date], "YYYY-MM" )
)
Add the Date column from the DateTable to a slicer in your report.
Create a Summary Table
Use the following DAX to create a summary table
SummaryTable =
VAR Seldate = SELECTEDVALUE('DateTable'[Date])
RETURN
SUMMARIZE(
'Sheet1',
'Sheet1'[Org name],
"Amount Before Selected Date",
CALCULATE(SUM('Sheet1'[Amount]), 'Sheet1'[Date] < Seldate),
"Amount After Selected Date",
CALCULATE(SUM('Sheet1'[Amount]), 'Sheet1'[Date] > Seldate)
)
Add a table visual to your report and use the SummaryTable to display the Org name, Amount Before Selected Date, and Amount After Selected Date.
- Aidarbek1 year agoNew Member
I can't understand why, but all the amount accounted in one group: