Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I have the following table
Branch | Earnings | Expense | Quarter |
A | 40000 | 12000 | Q1 |
A | 13000 | 11000 | Q2 |
B | 25000 | 20000 | Q1 |
B | 10000 | 23000 | Q2 |
C | 12000 | 13000 | Q1 |
C | 13000 | 15000 | Q2 |
I need to display a card visual showing a count of "healthy" branch (earnings > expenses), with a slicer showing the Quarter. I can create a card that show the data for 1 quarter, but when selecting multiple quarter, I need to make it so that I calculate the sum of earning and expenses for each branch on those quarters before displaying the count of healthy branch.
Is there a way of doing that?
Hope you are doing well. Based on the requirements you have shared, you can create a measure to calculate the count of "healthy" branches for the selected quarters. Here's an example of how you can do it:
Create a new measure and name it "Healthy Branches". Use the following formula:
Healthy Branches = COUNTROWS(FILTER(SUMMARIZE('Table', 'Table'[Branch], "Total Earnings", SUM('Table'[Earnings]), "Total Expenses", SUM('Table'[Expense]), "Quarter", 'Table'[Quarter]), [Total Earnings] > [Total Expenses]))
Drag and drop the "Quarter" column from your table into the slicer visual.
Add a card visual to your report and drag the "Healthy Branches" measure into it.
When you select one or multiple quarters from the slicer, the card visual will display the count of healthy branches for the selected quarters.
I hope this helps. Let me know if you have any further questions or concerns.
Ah okay, so you need to factor in the quarter too, try:
Thanks for the answer, this one is closer to what i need. From my understanding this use the latest quarter as the displayed value whereas i need to calculate the sum of earning and expenses of each branch on a selected period then calculate the amount of healthy branch from there. If i dont get another answer within 24 hr i'll just accept this as solution instead
Hi,
try this:
Thanks for the try, but that did not quite do it for example if i create the opposite of your measure to calculate "unhealthy" branch instead
Measure_2 = CALCULATE(COUNT('Table (5)'[Branch]),'Table (5)'[Earnings]<'Table (5)'[Expense])
if we select quarter 1 / quarter 2 independently, the value is correct and the total of branch will not exceed 3 (A,B,C) but when selecting all quarter using your measure, both measure1 and 2 displaying 3 branch each, totaling 6 which should not be possible because there are only 3 branch max
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
83 | |
69 | |
68 | |
39 | |
37 |