Forum Discussion
Card visual showing blank where matrix shows data
- 1 year ago
Hello fionabee,
Thank you for reaching out to the Microsoft Fabric Forum Community.
I have reproduced your scenario in Power BI using a sample dataset and implemented a measure like yours to calculate the % of Upheld Complaints. I also added:- A Matrix visual to display complaint subjects and uphold rates.
- A Card visual to show the overall uphold rate based on selected dates.
- A Date slicer connected to the complaint closure date.
After testing with previous months (e.g: May, June 2024) and the current month (July 2024), the Card visual returns the correct value as expected, without showing blank even when the Matrix displays breakdowns.
I used the following updated DAX measure to ensure the date slicer context is applied correctly:
% Upheld Complaints = VAR UpheldCount = CALCULATE( COUNTROWS('Received Complaints'), 'Received Complaints'[Outcome] = "Upheld", KEEPFILTERS(VALUES('Dates'[Date])) ) VAR TotalCount = CALCULATE( COUNTROWS('Received Complaints'), KEEPFILTERS(VALUES('Dates'[Date])) ) RETURN DIVIDE(UpheldCount, TotalCount, 0)For your reference, I’ve attached the .pbix file with this setup, so you can test it directly in your environment and validate the expected output.
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Hi fionabee ,
1. You can update your Dax as per the following to avoids the card visual returning blank (which it may do if TotalComplaints = 0 and there's no upheld rows).
DAX
% Upheld Complaints =
VAR TotalComplaints =
CALCULATE(COUNTROWS('Received Complaints'))
VAR UpheldComplaints =
CALCULATE(COUNTROWS('Received Complaints'), 'Received Complaints'[Outcome] = "Upheld")
RETURN
IF(
TotalComplaints = 0,
0,
DIVIDE(UpheldComplaints, TotalComplaints)
)
2. Go to Format → Edit Interactions and make sure the timeline slicer is affecting both:
The card & The matrix
⭐Hope this solution helps you make the most of Power BI! If it did, click 'Mark as Solution' to help others find the right answers.
💡Found it helpful? Show some love with kudos 👍 as your support keeps our community thriving!
🚀Let’s keep building smarter, data-driven solutions together! 🚀 [Explore More]