Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
There are five tables in my database:
Bill, Subscription, User, Credit card & Sites
In Subscription table, there is "type" column which contains below values:
Above in increasing order of price of subscription starting from Pro.
Over time our users have paid the varying amount within these subscriptions type. There is a “schedule” field where we tell you if it is a monthly or yearly plan.
You will also need to note that Bills have a column called “status.” The different statuses that a bill can have are:
For the amount, you can refer column "amount" in bills table.
Required Calculation:
Please find the .pbix file link:
https://www.dropbox.com/s/36y2nf2mf8cgb2u/Test17Sep.pbix?dl=0
Please Guide
Thanks in advance!
About first and third requirement, create the following column in bills table. About the other requirements, do you want to drag a user list or site list? Do you want to calculate the result based on static months(6 months and 11 months) by evaluating user's subscription or site's subsscription? Please post expected result in table format based on sample data in your PBIX file.
subscriptionid = RELATED(subscriptions[subscriptionid])
Then create a new table using dax below.
Table = CALCULATETABLE(bills,FILTER(bills,bills[subscriptionid]>=4 && (bills[status]="paid"||bills[status]="voided")))
Create the following columns in the new table.
bill_end pf per subscription = CALCULATE(MAX('Table'[bill_at]),ALLEXCEPT('Table','Table'[Site id],'Table'[subscriptionid]))
index = RANKX(FILTER('Table','Table'[Site id]=EARLIER('Table'[Site id])),'Table'[bill_end pf per subscription],,ASC,Dense)
pre = var prev=CALCULATE(FIRSTNONBLANK('Table'[subscriptionid],1),FILTER('Table','Table'[Site id]=EARLIER('Table'[Site id])&&'Table'[index]=EARLIER('Table'[index])-1)) return IF(ISBLANK(prev),'Table'[subscriptionid],prev)
checkupgradeOrDowngrade = IF('Table'[subscriptionid]>'Table'[pre],"upgrade",IF('Table'[subscriptionid]<'Table'[pre],"downgrade",BLANK()))
For more details, please review attached PBIX file.
Regards,
Lydia
@Anonymous
Thank you!
For other requirements, I need it by site list, no it should not be based on static months.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |