Forum Discussion
HDavila
6 years agoRegular Visitor
Grand Total not correct
Hi, I've been trying to calculate the grand totals but I don't understand why it is not calculating the right amount. Below you can see the table with the amounts that I have in different measures. ...
AlB
Community Champion
6 years agoHi HDavila
You'd need to show the code of your measures at the very least. Ideally share a pbix that reproduces the issue
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
- HDavila6 years agoRegular Visitor
Hi AlB ,
This is the DAX code I used for the Net Rev
PR Net Revenue =[PR Freight] + [PR TCO Hire] - [PR Address Comm] - [PR Broker Comm] + [PR Demurrage] + [PR Other Revenue] - [PR Offhire and Adj]Now for the individual measures, for example, for PR Freight this is the code (I use the same code for all measures the only difference is the column that is referenced on the first variance, in this example is the Freight column):PR Freight =VAR TotalFreight =SUMX('VPR Raw Data','VPR Raw Data'[Freight])ReturnVAR TotalVoyageDays =SUMX('VPR Raw Data','VPR Raw Data'[Voyage Days])ReturnDIVIDE(TotalFreight,TotalVoyageDays) * [Prorated days]For Prorated days:Prorated days = VALUE(SUMX('VPR Raw Data','VPR Raw Data'[Prorated End date] -'VPR Raw Data'[Prorated Start Date]))Hopefully, this helps.