Forum Discussion
PowerBI DAX
Hi GauravKasar
to calculate Total Revenue dynamically based on the selected month, first create a Date Table and link it to SubscriptionData[subscription_date]. Then, use this measure:
I have attached the PowerBIDAX.pbix file for reference.
If this response was helpful, please accept it as a solution and give kudos to support other community members.
Hello ArwaAldoud,
I really appreciate your efforts for providing the solution.
But in your solution, it is not showing the revenue for the months for which there are no new subscribers (e.g., March-2024, where the revenue is $900 from the past month subscribers).
Also the expected solutions (that I calculated manually) are not matching.
Below are the expected outputs:
| Month | individual revenue breakup | Revenue (Excpected solution) |
| Jan-24 | 200+100 | 300 |
| Feb-24 | 100+200+100+100+100+200 | 800 |
| Mar-24 | 100+200+100+100+200+200 | 900 |
| Apr-24 | 200+200+100+200+100+100+200+200 | 1300 |
| May-24 | 100+100+200+200+100+200+100+200+200+200 | 1600 |
| so on… |
Please check.
Thanks,
Gaurav Kasar
- ArwaAldoud1 year agoSuper User
Hi GauravKasar
Since the relationship in the DateTable is based on subscription_date, selecting a month from the DateTable filters SubscriptionData only by subscription_date, ignoring plan_change_date.
There are multiple ways to solve this issue, but I chose to create calculated columns instead of a measure. This approach helps with debugging and ensures the logic is correctly applied to each row.
I created the following calculated columns: Effective_Month, Effective_Plan and Effective_Year. Then, I calculated revenue based on these columns.
Additionally, I created two measures:
Revenue per Selected MonthCumulative Revenue (as per your recent request with the expected results)
You can find the attached .pbix file for reference.
If this response was helpful, please accept it as a solution and give kudos to help other community members.
- v-kathullac1 year agoCommunity Support
Hi GauravKasar ,
we wanted to kindly follow up to check if the solution provided by the superuser for your issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,Chaithanya.