Forum Discussion
Calculate Revenue Based On Fixed AND Variable Amount
- Anonymous1 year ago
Hi Ed2563 , hello all, thank you for your prompt reply!
Based on the total value issue, please try as following:Adjusted Revenue = VAR ClientID = SELECTEDVALUE(fact_clients[client_id]) VAR JobCount = CALCULATE( COUNTROWS(dim_jobs), dim_jobs[client_id] = ClientID ) VAR test=IF(ClientID = "be1259a7-bc71-4b30-9c42-8568874bd87b"&&JobCount>0, // xxyyzz Client ID IF(JobCount <= 900, 50000, // $50,000 if the job count is less than or equal to 900 50000 + SUM(dim_jobs[final_revenue_total]) ), SUM(dim_jobs[final_revenue_total])) // $50,000 + the revenue for jobs above 900 RETURN testTotalRevenue = SUMX(VALUES('fact_clients'[client_name]),[Adjusted Revenue])SumofTotalFinal = SUMX(VALUES(dim_dates[Date].[Month]),[TotalRevenue])TotalValue = IF( ISINSCOPE(dim_dates[Date].[Month]), SUMX(VALUES(fact_clients[client_name]), [Adjusted Revenue]), IF( ISINSCOPE(fact_clients[client_name]), SUMX(VALUES(dim_dates[Date].[Month]), [Adjusted Revenue]), [SumofTotalFinal] ) )Result for your reference:
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous1 year ago
Hi Ed2563,
Sorry for the missing month value for the date column in the DAX. I have updated the answer and pbix file above. Please check it.
Sorry for the late response. I got tied up with other tasks.
I have implemented this solution and it works as expected except for the column subtotals. Even your example shows 250,000 as the column subtotal, despite the fact that there are only 4 columns with data for Client xxyyzz (4 * 50,000=200,000).
Hi Ed2563,
Sorry for the missing month value for the date column in the DAX. I have updated the answer and pbix file above. Please check it.