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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Almaamari
New Member

Matrix not filtering properly because of measure

I have a table called ProcessLog, which tracks batches processed for migration and the various stages each batch has gone through or is currently undergoing. To visualize this data, I'm using a Matrix visual with BatchName as Rows and StageName as Columns. I've enabled the "Show items with no data" option for the StageName column to ensure all stages are displayed. Additionally, I've created a measure called "RefinedStatus" to replace blank statuses with "Not Started" while retaining other statuses. There's an Organization filter at the top, and the ProcessLog table includes an OrganizationId column as a foreign key to filter batches based on the selected organization.

 

RefinedStatus = IF(
ISBLANK(SELECTEDVALUE('ProcessLogging'[Status])),
"Not Started",
SELECTEDVALUE('ProcessLogging'[Status])
)

 

The issue I'm encountering is that when I select an organization without any associated batches, the matrix visual displays all batches with a status of "Not Started." I want the Matrix to first filter the batches based on the selected organization and then display the status based on the stage. 


I have pasted few snapshots to explain the scenario.
Before Filter.jpg

 

After Org Filter.jpg

 


My Data Model.

Data Model.jpg

 

 

3 REPLIES 3
Almaamari
New Member

Hi Wilson,

               Sorry i may not have explain my problem well. I want to show all the Batches by default even if it doesn't have any entry in the processLog table and the status as "not started" if a batch doesn't have any entry for the stage(s). Picture below.  Once filter is applied then i want to show only the batches related to that organization and then Show "Status" of a Batch for each stage. 
Desired Output.jpg

 




After using the suggested Dax, two things are happening . It's not showing all the batches if no filter is applied and it doesn't show the "Not Started" status for all the stages. 


Suggested Measure.jpg

 



Hi Almaamari,

 

Thanks for clarifying the issue. Oops, I did not see your data model originally. Can you please provide a sample pbix? (If you don't know how, please check the pinned thread in the forum.) I have an idea for a solution but I will need to tinker a bit with it first.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Wilson_
Super User
Super User

Hi Almaamari,

 

Try something like the below. The measure first checks to see whether the batch exists at all, regardless of status, before applying your logic.

 

RefinedStatus =
VAR Filtered =
CALCULATETABLE (
    'ProcessLogging',
    REMOVEFILTERS ( 'ProcessLogging'[Status]
)
VAR BatchExists = NOT ( ISEMPTY ( Filtered ) )
VAR Result =
IF ( 
    BatchExists, 
    COALESCE ( SELECTEDVALUE ( 'ProcessLogging'[Status] ), "Not Started" )
)

RETURN Result

 

----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.