Forum Discussion
Prima_
3 years agoResolver I
HardCoded value works
Hi, If I hardcode the value of the Product, in the Column, it calculates the Sum the Sales by Product correctly. TotalYTD = TOTALYTD(SUM('Table'[Sales]),'CALENDAR_Table'[Date],filter('Table','Ta...
Anonymous
3 years agoNot applicable
HI Prima_,
You can try to use the following measure formula if it suitable for your requirement:
YTD =
VAR currdate =
MAX ( 'CALENDAR_Table'[Date] )
RETURN
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER (
ALLSELECTED ( 'Table' ),
YEAR ( Table[Date] ) = YEAR ( currdate )
&& Table[Date] <= currdate
),
VALUES ( Table[Product] )
)
Regards,
Xiaoxin Sheng
- Prima_3 years agoResolver I
Thank you.
This measure returns the same value (sum of sales for all months for the selected product) for all the months. For the data shown below, it returns 4039 as the value for all months.
- Anonymous3 years agoNot applicable
Hi Prima_,
Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng