Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I have a table with freight cost on different channels, for example an average freight cost on one channel is 30 EUR one month and 33 EUR antoher month. I have added the average freight cost for an order specified per month in that table (added it for all months). I have then created a relation to a Date table. On the other side we do have revenues. When I calculate the margin the freight cost is only calculated the single day per month (first day of every month) and the margin is then not correct when I look over a certain operiod in the visualization.
How can I use that monthly cost to be valid for all the days on the choosed months?
Thanks:)
BR
Adreas
Solved! Go to Solution.
Hi,
First write this measure
Measure 1 = sum(freighttable2[Inkl lost])
In my measure, replace Inkl lost with Measure 1.
Hope this helps.
Thanks for your reply, means a lot! I have been trying to work more with it. The meassure that does not work properly is:
SUMX('freighttable2',[Inkl lost]
This also works correct for the selected filtered period.
Hi @andreasanderzon,
Since I do not have any sample data to refer or any measure for the calculations that you have done, what I can tell is that double check the columns that you are using for your calculations and if you added them in visuals then check the filters that are being applied. Your date slicer might be filtering the values that you need and in turn affecting your result.
Did I answer your question? Mark this post as a solution if I did!
Consider taking a look at my blog: Forecast Period - Previous Forecasts
Thanks for your reply, means a lot! I have been trying to work more with it. The meassure that does not work properly is:
SUMX('freighttable2',[Inkl lost]
This also works correct for the selected filtered period.
The issue is when I use this formula:
SUMX('freighttable2',[Inkl lost] *[Number orders])
I guess the issue is that in the freight cost table I want to add the cost for the total month, but when I import the data from excel it calculate the cost for orders from that specific date.
Here is examle how the table with greigh costs looks like:
Channel 1 | 2022-09-30 | 27,08 |
Channel 1 | 2022-10-31 | 27,08 |
Channel 1 | 2022-11-30 | 27,08 |
Channel 1 | 2022-12-31 | 27,08 |
Channel 2 | 2022-09-30 | 71,725 |
Channel 2 | 2022-10-31 | 71,725 |
Channel 2 | 2022-11-30 | 71,725 |
and so on..
I do want to have the possibility to change the freight cost on monthly basis, but how can I make this without adding every day in the table? (I have 40 different sale channels).
Thanks!:)
Hi,
Not sure of what you want but try this measure
=SUMX(generate(values(calendar[Month name]),values(calendar[year])),[Inkl lost] *[Number orders])
Ensure you have a Calendar Table with calculated column formulas for Year, Month name and Month number. Sort the Month name column by the Month number. Create a relationship (Many to One and Single) from the Date column of the Data Table to the Date column of the Calendar Table.
If this does not help, then share the download link of your PBI file.
Hi, Thanks for your reply.
I used =SUMX(generate(values(calendar[Month name]),values(calendar[year])),[Inkl lost] *[Number orders])
, just changed the Dax vale names to match my dax table. I only got one error, the [Inkl lost] is not found since it is only a column in the tabe 'freighttable2'. How can I adapt the formula to pick up the column and not the meassue [Inkl lost]?
The table source:
Channel Date Inkl Lost
Channel 1 | 2022-09-30 | 27,08 |
Channel 1 | 2022-10-31 | 27,08 |
Channel 1 | 2022-11-30 | 27,08 |
Channel 1 | 2022-12-31 | 27,08 |
Channel 2 | 2022-09-30 | 71,725 |
Channel 2 | 2022-10-31 | 71,725 |
Channel 2 | 2022-11-30 | 71,725 |
Hi,
First write this measure
Measure 1 = sum(freighttable2[Inkl lost])
In my measure, replace Inkl lost with Measure 1.
Hope this helps.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
87 | |
82 | |
71 | |
49 |
User | Count |
---|---|
143 | |
123 | |
107 | |
61 | |
55 |