Forum Discussion
Problem with my formula
- Anonymous5 years ago
Hi RonaldvdH
I build a sample to show you how to get running total from another table.
Sales:
Date:
Date = ADDCOLUMNS ( CALENDARAUTO (), "Year", YEAR ( [Date] ), "Month", MONTH ( [Date] ), "MonthName", FORMAT ( [Date], "MMMM" ) )Relationship: Date[Date] —— Sales[SalesDate]
Measure:
Measure = CALCULATE( COUNTROWS(Sales), FILTER(ALL('Date'),'Date'[Date]<=MAX('Date'[Date])), FILTER(ALL(Sales),Sales[SalesDate] <>BLANK()) )+0Blank in SalesDate column will cause blank in columns in Date table in visual, due to relationship. Remove blank in Date column in Filter Field. Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi RonaldvdH
I build a sample to show you how to get running total from another table.
Sales:
Date:
Date =
ADDCOLUMNS (
CALENDARAUTO (),
"Year", YEAR ( [Date] ),
"Month", MONTH ( [Date] ),
"MonthName", FORMAT ( [Date], "MMMM" )
)
Relationship: Date[Date] —— Sales[SalesDate]
Measure:
Measure =
CALCULATE(
COUNTROWS(Sales),
FILTER(ALL('Date'),'Date'[Date]<=MAX('Date'[Date])),
FILTER(ALL(Sales),Sales[SalesDate] <>BLANK())
)+0
Blank in SalesDate column will cause blank in columns in Date table in visual, due to relationship. Remove blank in Date column in Filter Field. Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.