Forum Discussion
Ed2563
1 year agoFrequent Visitor
Calculate Revenue Based On Fixed AND Variable Amount
If this type of question has been posted previously, I haven't been able to find it. I am also new to Power BI and have read Microsoft's documentation on DAX, as well as experimented with many type ...
- 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.
Ashish_Mathur
Super User
1 year agoHi,
Share some sample data to work with and show the expected result. Share data in a format that can be pasted in an MS Excel file.
- Ed25631 year agoFrequent Visitor
Hello,
I shared as much information as I can in the original post.