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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
samoberoi
Helper III
Helper III

undefined

Hi,

 

I have data and i created a normal switch statement to show if the amount is greater than 2 million then it should be Green and if between 2 million and 1 million then it should be Yellow otherwise should be Red. This was simple, but i now want to show that what the total financial value of Green category e.g. if it is £1268800 then what should its percentage from the grand total of the Financial values and similarly for the other two categories of Yellow and Red depending on each of their total financial value. So, in a nutshell it should give me the percentage of the total financial value from the Grand total for each Green, Yellow & Red bucket.

Thanks

4 REPLIES 4
Anonymous
Not applicable

Hi @samoberoi ,

Please check the attachment.

vcgaomsft_0-1695118408278.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Hi,

 

Thanks for your reply with the solution. There are a few things on the measure 'Rate' which i can't understand how that functions and what some of the things within it are e.g how does "C",[Color] and "T",[Total]) and [Color]=_c),[T]) work as showing in your formula below. Sorry, i may not be understanding it better. Please explain it a bit further for me. 

Thanks

 

Rate =
VAR _c = [Color]
VAR _total_by_c = CALCULATE(SUMX(FILTER(SUMMARIZE('Table','Table'[Category],"C",[Color],"T",[Total]),[Color]=_c),[T]),ALL('Table'[Category]))
VAR _result = DIVIDE([Total],_total_by_c)
RETURN
_result
Anonymous
Not applicable

Hi @samoberoi ,

SUMMARIZE('Table','Table'[Category],"C",[Color],"T",[Total])

The code above creates a virtual table like this.

vcgaomsft_0-1695195264244.png
This line is declaring a variable _c and assigning it the value of the current row's color

VAR _c = [Color]

vcgaomsft_1-1695195381027.png
Filter virtual table for rows ('virtual table'[C]) equal to the current row color(variable _c).

FILTER(SUMMARIZE('Table','Table'[Category],"C",[Color],"T",[Total]),[Color]=_c)

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.