Forum Discussion
Running total and null values
- 9 years ago
I found the solution!
Wrong: MTD Invoiced = CALCULATE(SUM(Invoicing[Qty]),FILTER(ALLSELECTED(Invoicing),Invoicing[Day]<=MAX(Invoicing[Day])))
Correct: MTD Invoiced = CALCULATE([Invoiced Qty],filter(ALLSELECTED('Table for Chart'),'Table for Chart'[Day Index]<=max('Table for Chart'[Day Index])))
As you can see, the second is referencedto the new table I created. now it show each time the MTD.
Couple things you can try
1) Go to the Date filed in the Values area of the Table Visual => click the down arrow => select Show Items with No Data
2) Reference the Date column from your Calendar Table instead
MTD Invoiced =
CALCULATE (
SUM ( Invoicing[Qty] ),
FILTER (
ALLSELECTED ( CalendarTable ),
CalendarTable[Date] <= MAX ( CalendarTable[Date] )
)
)
+ 0The + 0 is optional but it will give you basically leading zeros if your Calendar Starts prior to any transactions and you want those dates to show 0.
For example first few days of a Year selected in a Slicer!
Hope this helps! :smileyhappy:
- LS17009 years agoResolver I
Hey,
thanks for your answer.
Show items with no data is already selected.
I cannot reference to the Date because I intentionally want to look at the day of the month. I want to compare the results with other months or other data (such as open orders...).
I appended to the invoice table 31 lines, so that I have all days of the month. Now it is a bit better, but as soon as I filter out (E.g. I select a specific area) I have null values.
The "+0" did not work either. it creates 0 values.
Any other suggestion?
thanks
LS
- LS17009 years agoResolver I
I found the solution!
Wrong: MTD Invoiced = CALCULATE(SUM(Invoicing[Qty]),FILTER(ALLSELECTED(Invoicing),Invoicing[Day]<=MAX(Invoicing[Day])))
Correct: MTD Invoiced = CALCULATE([Invoiced Qty],filter(ALLSELECTED('Table for Chart'),'Table for Chart'[Day Index]<=max('Table for Chart'[Day Index])))
As you can see, the second is referencedto the new table I created. now it show each time the MTD.