Forum Discussion
Dax Calcualtion
I wonder if anyone could help with this one, i am totally at a loss and not sure if it can be done. Please bear with me as it is a hard one to explain
I have a data table and a table with Sales within Power Bi
I would like a calcualtion that has a total sales figures for the year (i am using fiscal year but that is fine!) however here is the problem. We sign a contract for 12 months however the orginals sales order equals monthly revenue, so if we win a contract in month 1, there is no order in month 2, so sales for this customer is £100 for the year and not £1200. I do not want to put £1200 in the first month.
I have tried to show below, you can see that we have signed 3 customer in jan, mar and july for £100 per month which equates to £2800
| Customer a | Customer b | Customer c | Total | |
| Jan | 100 | 100 | ||
| Feb | 100 | 200 | ||
| Mar | 100 | 100 | 400 | |
| Apr | 100 | 100 | 600 | |
| May | 100 | 100 | 800 | |
| Jun | 100 | 100 | 1000 | |
| Jul | 100 | 100 | 100 | 1300 |
| Aug | 100 | 100 | 100 | 1600 |
| Sep | 100 | 100 | 100 | 1900 |
| Oct | 100 | 100 | 100 | 2200 |
| Nov | 100 | 100 | 100 | 2500 |
| Dec | 100 | 100 | 100 | 2800 |
- Anonymous8 years ago
Hi tmears,
So you want to know the YTD total price of each customers, right?
If this is a case, you can try to use below measure to calculate the YTD total.
Total = SUMX ( FILTER ( ALLSELECTED( Table1 ), DATEVALUE ( [Month] & "/1" ) <= DATEVALUE ( MAX ( [Month] ) & "/1" ) ), [Customer a] + [Customer b] + [Customer c] )Regards,
Xiaoxin Sheng
1 Reply
- AnonymousNot applicable
Hi tmears,
So you want to know the YTD total price of each customers, right?
If this is a case, you can try to use below measure to calculate the YTD total.
Total = SUMX ( FILTER ( ALLSELECTED( Table1 ), DATEVALUE ( [Month] & "/1" ) <= DATEVALUE ( MAX ( [Month] ) & "/1" ) ), [Customer a] + [Customer b] + [Customer c] )Regards,
Xiaoxin Sheng