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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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:
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!
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
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])
=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.
In the end I need one amount, the sum of all revenues
you are missing the closing bracket for SELECTEDVALUE
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
User | Count |
---|---|
15 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
28 | |
18 | |
15 | |
7 | |
6 |