Forum Discussion
Measure TOTALQTD not working
I have two tables:
- 1. Sales by product ID
- 2. Time
There's a relationship between these two tables where cardinality is many to one (*:1) and cros filter direction is both. The field key is the date on both tables.
I've just created 3 measures: Year-to-date, Month-to-date and Quarter-to-date however the last one isn't working properly. QTD is showing the same values as MTD measure.
I tried both syntaxis por QTD measure both it yielded the same result.
Syntaxis 1: QTD Sales income = TOTALQTD(SUM(SalesbyProd[Sales income]),DATESQTD('Time'[Date])
Syntaxis 2: QTD Sales income = CALCULATE(TOTALQTD(SUM(SalesbyProd[Sales income]),DATESQTD('Time'[Date]),ALL('Time'[Date])))
Help please.
8 Replies
- jstorm
Resolver III
The syntax should be...
TOTALQTD(
SUM( SalesbyProd[Sales income] ),
'Time'[Date]
)
Can you post a screenshot of your model? Can you post you MTD and YTD measure syntax?
- JoseQFrequent Visitor
hi, thanks for the fast response.
I tried changing the syntaxis but gave the same results.
By model you mean relationships if so.. this is the model..
- jstorm
Resolver III
Is your sales data only being recorded once per quarter? For example,
3/1 $1000
6/1 $2000
9/1 $1500
12/1 $1000
Try putting your data into a table visualization without any measures to see if there are any inconsitencies or some underlying logic you are not considering.
- JoseQFrequent Visitor
My sales data is being recorder daily.
However my time table is comprised of difrente time scales: daily, weekly, monthly, bimestraly, quarterly, triannually and semestraly...
This for example:
[CONFIDENTIAL INFO.]
- jstorm
Resolver III
Set up a table visualization with Time[Month], Time[Quarter], Time[Year], and your YTD, MTD, QTD measures. Check to see if there are problems there and post a screenshot. Also, check your columns in Time and Sales to be sure they are the right data type.