Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
mattwoldt
Frequent Visitor

How to dynamically calculate commissions by month

Hello!

 

Have a bit of an interesting one I think. I work in commercial real estate and I am trying to show by month what their monthly revenue falls under in their respective commissions. 

 

I have a monthly GL that I get revenue from and I also have the running total set up so I can know cumulatively where they sit in their commission tranches. What I then want to do is show of that month how are they progressing through their tranche. Example dataset below:

Tranche NumberTranche RevenueTranche RateCumulative RevenueMonthly Revenue
1

0

50%$983,849.41$564,594.14
2

$500,000

55%$983,849.41$564,594.14
3$750,00060%$983,849.41$564,594.14
4$1,200,00065%$983,849.41$564,594.14

 

Essentially it works like a tax bracket, so how I want the data to show is this:

Tranche RevenueTranche RateMonthly Revenue Breakdown

0

50%$80,744.59

$500,000

55%$250,000
$750,00060%$233,849.55
$1,200,00065%

$0


The total being that monthly revenue of $564,594.14

The goal of this is to show what monthly revenue we have in each tranche rate, but it is very dynamic and millions of rows with difference tranche structures. 

My logic on how I got to the above table is this:

The cumulative revenue is $983,849.41. I subtracted the monthly revenue of $564,594.14 to get to what they have cumulatively done in past months and that was: $419,255.27. 
So that means that $419,255.27 has taken up the $500K threshold, so now there should be $80,744.73 slotted in the $500K threshold because once they eclipse that amount by year they start earning at a higher rate of 55%. 

We now have $483,849.41 left to go through. 

The threshold is $500 - $750K, this means it will just be completed that month too, so simply you just know it has to be $250K. 

Then the remainder is put in the $750K threshold because they haven't eclipsed $1.2M. 

The tricky part is I am just unsure how to make this dynamic, like I said there can be a multitude of tranches, some are 1 line, some are six with varying levels of revenue and I get the revenue by month not by day. 

I have some helper tables as well that show a 1 if it is the first time they have surpassed the revenue level, this helps because I can tell power bi so no longer apply future revenue to that specific level. 

Anyways, let me know your thoughts, I know it is possible as this is mainly just very alegebra based. 

Thank you!!


2 ACCEPTED SOLUTIONS
v-csrikanth
Community Support
Community Support

Hi @mattwoldt 

Thank you for being part of the Microsoft Fabric Community.

You may consider the following steps to potentially resolve your issue.

  • Make sure the 'Data Type' table used in the slicer is not related to your main fact table. It should be a disconnected table strictly used for selection purposes.
  • Use the SELECTEDVALUE() function inside measures (not in calculated columns or tables) to capture the user's choice from the slicer.
  • Build dynamic measures using conditional logic with SWITCH() or IF() statements that check the selected value and apply the corresponding measure (like Budget, Forecast, Actuals) based on the financial year or any other condition.

Example:

DAX

CopyEdit

DynamicMeasure =

SWITCH(

    TRUE(),

    SELECTEDVALUE('DataType'[Type]) = "Budget" && Year = "FY25", [BudgetMeasure],

    SELECTEDVALUE('DataType'[Type]) = "Forecast" && Year = "FY25", [ForecastMeasure],

    [ActualsMeasure]

)

  • Don’t use SELECTEDVALUE() in calculated tables or columns, as those are static and don’t respond to slicer interactions during report use.

This method will allow your visuals to refresh dynamically based on what users select in the slicer, showing the correct figures for the selected type and year.

If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!

Looking forward to your reply!

Best Regards,

Community Support Team _ C Srikanth.

 

 

View solution in original post

pankajnamekar25
Super User
Super User

Hello @mattwoldt 

 

Try this 2 measure

MonthlyRevenueAllocated =

VAR CumRev = SELECTEDVALUE('FactTable'[CumulativeRevenue])

VAR PrevCumRev = CumRev - SELECTEDVALUE('FactTable'[MonthlyRevenue])

VAR StartRev = SELECTEDVALUE('TrancheTable'[StartRevenue])

VAR EndRev = SELECTEDVALUE('TrancheTable'[EndRevenue])

 

VAR RevenueInTranche =

    MIN (

        MAX ( 0, MIN ( CumRev, EndRev ) - MAX ( PrevCumRev, StartRev ) ),

        SELECTEDVALUE('FactTable'[MonthlyRevenue])

    )

 

RETURN

    RevenueInTranche

 

 

 

MonthlyCommissionByTranche =

[MonthlyRevenueAllocated] * SELECTEDVALUE('TrancheTable'[Rate])

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

View solution in original post

6 REPLIES 6
v-csrikanth
Community Support
Community Support

Hi @mattwoldt 

We haven't heard from you since last response and just wanted to check whether the solution provided has worked for you. If yes, please Accept as Solution to help others benefit in the community.
Thank you.

If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.

v-csrikanth
Community Support
Community Support

HI @mattwoldt 

It's been a while since I heard back from you and I wanted to follow up. Have you had a chance to try the solutions that have been offered?
If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!

Best Regards,
Community Support Team _ C Srikanth.

v-csrikanth
Community Support
Community Support

Hi @mattwoldt 

I wanted to follow up since I haven't heard from you in a while. Have you had a chance to try the suggested solutions?
If your issue is resolved, please consider marking the post as solved. However, if you're still facing challenges, feel free to share the details, and we'll be happy to assist you further.
Looking forward to your response!

Best Regards,
Community Support Team _ C Srikanth.

pankajnamekar25
Super User
Super User

Hello @mattwoldt 

 

Try this 2 measure

MonthlyRevenueAllocated =

VAR CumRev = SELECTEDVALUE('FactTable'[CumulativeRevenue])

VAR PrevCumRev = CumRev - SELECTEDVALUE('FactTable'[MonthlyRevenue])

VAR StartRev = SELECTEDVALUE('TrancheTable'[StartRevenue])

VAR EndRev = SELECTEDVALUE('TrancheTable'[EndRevenue])

 

VAR RevenueInTranche =

    MIN (

        MAX ( 0, MIN ( CumRev, EndRev ) - MAX ( PrevCumRev, StartRev ) ),

        SELECTEDVALUE('FactTable'[MonthlyRevenue])

    )

 

RETURN

    RevenueInTranche

 

 

 

MonthlyCommissionByTranche =

[MonthlyRevenueAllocated] * SELECTEDVALUE('TrancheTable'[Rate])

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

v-csrikanth
Community Support
Community Support

Hi @mattwoldt 

I wanted to follow up since I haven't heard from you in a while. Have you had a chance to try the suggested solutions?
If your issue is resolved, please consider marking the post as solved. However, if you're still facing challenges, feel free to share the details, and we'll be happy to assist you further.
Looking forward to your response!

Best Regards,
Community Support Team _ C Srikanth.

v-csrikanth
Community Support
Community Support

Hi @mattwoldt 

Thank you for being part of the Microsoft Fabric Community.

You may consider the following steps to potentially resolve your issue.

  • Make sure the 'Data Type' table used in the slicer is not related to your main fact table. It should be a disconnected table strictly used for selection purposes.
  • Use the SELECTEDVALUE() function inside measures (not in calculated columns or tables) to capture the user's choice from the slicer.
  • Build dynamic measures using conditional logic with SWITCH() or IF() statements that check the selected value and apply the corresponding measure (like Budget, Forecast, Actuals) based on the financial year or any other condition.

Example:

DAX

CopyEdit

DynamicMeasure =

SWITCH(

    TRUE(),

    SELECTEDVALUE('DataType'[Type]) = "Budget" && Year = "FY25", [BudgetMeasure],

    SELECTEDVALUE('DataType'[Type]) = "Forecast" && Year = "FY25", [ForecastMeasure],

    [ActualsMeasure]

)

  • Don’t use SELECTEDVALUE() in calculated tables or columns, as those are static and don’t respond to slicer interactions during report use.

This method will allow your visuals to refresh dynamically based on what users select in the slicer, showing the correct figures for the selected type and year.

If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!

Looking forward to your reply!

Best Regards,

Community Support Team _ C Srikanth.

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors