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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

SWITCH measure for calculating Revenue

Hello! I am trying to make calculations of revenues in my report, using the measure SWITCH and facing some issues.

I need to calculate revenues, which are depends on the statement in the rows. Basically, what I have is:

  • Column with several provider’s names
  • Column with total revenue share

 

What I need to do is to calculate the revenue share for each provider. Currently I have three providers and each one of them has its one rules to calculate revenue share.

 

So, for example:

 

If I have Provider 1 in the row, that the rule “Revenue share*0.525” needs to be apply

If I have Provider 2 in the row, that the rule is changing to “Revenue share*0.5”

If I have Provider 3 in the row that I have to take the value from another column from the report

 

What I was trying to do is:

 

= SWITCH(

                  TRUE(),

                 SUM(‘Table’[Provider name]) = “Provider 1”, CALCULATE (

 

And I an stuck on this step, since it would not give me the option to choose any column, rather then measures in my table.

 

You might have any suggestions on this? I may be need even use another measure... I am quite new to Power BI, so your help would be very much appreciated!

 

Thank you in advance! 

9 REPLIES 9
AntrikshSharma
Super User
Super User

Does this meet your requirements?

 

Revenue =
VAR ProviderName = Table[ProviderName]
VAR TotalRevenue = SUM ( ForBI[Revenue] )
VAR Result =
    SWITCH (
        TRUE,
        ProviderName = "Provider 1", TotalRevenue * 0.525,
        ProviderName = "Provider 2", TotalRevenue * 0.5,
        ProviderName = "Provider 3", [AnotherColumnName],
        0
    ) // Return 0 if none of the above conditions satisfy, change it to something else according to your requirements.
RETURN
    Result

 

lbendlin
Super User
Super User

move the calculations out of the SWITCH statement. You only need the switch for the factor. You don't need the TRUE() construct.

 

=sum(revenue)*switch([Provider Name],"Provider 1",.525,"Provider 2",.5,[other column])

Anonymous
Not applicable

=sum(revenue)*switch here it does't allow me to insert the column with provider name, I assume because it is not a measure. I assume I need some aggregator formula there 

yes, you can use SELECTEDVALUE() or MAX() - depends on your personal preferences, and also depends on how you want to handle totals.

Anonymous
Not applicable

In the end I need one amount, the sum of all revenues

Anonymous
Not applicable

However, it gives an error, after I am inserting "Provider 1" and later doesn't allow to choose [other column]
SUM( 'For BI'[Revenue share])*SWITCH(SELECTEDVALUE('For BI'[Provider name],"Provider 1",.525,"Provider 2",.5,

you are missing the closing bracket for SELECTEDVALUE

Anonymous
Not applicable

Now, it is working only untill the point, where I have to insert the [other column]

 

SUM( 'For BI'[Revenue share])*SWITCH(SELECTEDVALUE('For BI'[Provider name]),"Provider 1",.525,"Provider 2",.5,

 

Still doesn't allow to choose any column, except the ones with measures....

use SELECTEDVALUE again for the other column

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.