Forum Discussion
Opening Stock For Multiple Products
- 4 years ago
Hi, hammerman
You can manually modify the value of total. Use SELECTEDVALUE ( table[column]1 ) = BLANK ().
Like this:
measure = IF ( SELECTEDVALUE ( Date[Date] ) = BLANK (), CALCULATE ( SUM ( Table[Inventory Value] ) ),//calculate total sum CALCULATE ( LASTNONBLANKVALUE ( Date[Date], SUM ( Table[Inventory Value] ) ), FILTER ( ALL ( 'Date' ), 'Date'[Date] <= MAX ( 'Date'[Date] ) ) ) )Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
Thanks amitchandak although unfortunately that hasn't worked. I'd like it to sum up the total across each product for each date from the inventory table at the total level. This formula just gives me the last non blank.
I've got a date table and a product control table in my model. I'm thinking it might be something like for each date SUMX the last non blank?
- v-janeyg-msft4 years ago
Community Support
Hi, hammerman
You can manually modify the value of total. Use SELECTEDVALUE ( table[column]1 ) = BLANK ().
Like this:
measure = IF ( SELECTEDVALUE ( Date[Date] ) = BLANK (), CALCULATE ( SUM ( Table[Inventory Value] ) ),//calculate total sum CALCULATE ( LASTNONBLANKVALUE ( Date[Date], SUM ( Table[Inventory Value] ) ), FILTER ( ALL ( 'Date' ), 'Date'[Date] <= MAX ( 'Date'[Date] ) ) ) )Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,
Community Support Team _ Janey