Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am looking to cacluate a new measure that gives me the sum of the month to date tonnages of the current parameter "CoalTonnes" I cannot seem to get the syntax correct.
Solved! Go to Solution.
DATESMTD returns a set of dates, not a total for month to date. Try something like:
MTDTonnes = TOTALMTD(SUM('Coal-Day'[CoalTonnes]),'Coal-Day'[Date])
DATESMTD returns a set of dates, not a total for month to date. Try something like:
MTDTonnes = TOTALMTD(SUM('Coal-Day'[CoalTonnes]),'Coal-Day'[Date])
Thanks for the suggestion Steve, but that formula returns the same as original CoalTonnes field without any summarisation.
It looks like you've created it as a Column rather than a Measure, with your screenshot of the Data View?
Try creating it as a Measure instead, and display it via a Table, Chart or other visual.
Thank you sir, I shall do just that.
Steve,
I did as you suggested, but as I feared, it made no difference. It still presents the exact same number as the indeividual day. In the charts below, whichever dataset you plot last represents the colour of the line. As there is only one line, but two data sets, they must be representing the same thing.
Sorry, it shouldn't be this hard...
I can't see why you've got a range of 0-25 on your X axis when you're using the Date column. Can you load a sample PBIX to OneDrive etc. and post a link so I can check further ?
Cheers,
Steve.
Hey Steve,
You are seeing integers because currently I'm only displaying the "day" from the date in the x axis. I would have liked to see more than one in every 5 and it was my attempt to save space. To tell you the truth mate, at this point it isnt that huge of a drama. I was trying to make it "slick" in the program so it couild handle variations in the data stream, but for the purposes I am using now I can simply build the MTD values into a dataset in a spreadsheet.
I'm definitely going to revisit this at a later time however opnce the datasets get larger.
Cheers,
Mark
Mark,
That explains it - TOTALMTD expects a Date data type, not an integer, across which to total.
Good luck.
Hi Steve,
The formula is using the entire date field. I only set the axis to view a single day to avoid congestion. thank you very much for your help.
It is greatly appreeciated!
Cheers,
Mark
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |