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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Fuzz_ZA
Frequent Visitor

Need Help - Cross-Table Query Into Matrix Visual

Greetings Community.

Firstly, I'm new to Power BI with 1 week. I am building a dashboard for our department using DirectQuery. The dashboard connects to two tables in a SQL DB. The primary data table "MIData" contains various columns which most of the dashboard will be composed from. The second table "MIMetrics" is static with the purpose of storing threshold values and is small and will never change. Both tables contain a column called "processName" and my intent was to use that column to create a Power BI realtionship.
"MIData" has the following structure:

 processNameitemCreateditemEndattemptWorkTimeitemStatusitemDescription
1Process 12025-08-01 13:14:152025-08-01 14 22:16168ReferredCase referred to dept.
2Process 12025-08-01 13:14:232025-08-01 14 23:18145CompletedCase processed
3Process 22025-08-01 15 08:352025-08-01 15 38:51182ReferredCase referred to dept.
4Process 32025-08-02 09:22:162025-08-02 10:44:23143OnHoldPending information

 

"MIMetrics" has the following structure:

processNameCompletedReferredOnHold
Process 100:05:0000:03:0000:07:00
Process 200:02:3000:01:0000:04:15
Process 300:03:0000:08:0000:04:45

MIMetrics is used to measure whether "Process 1" and its assoc. column names (which are time(0) SQL data types) were above or below the stated time in the column.

I have built a basic matrix view with a single-select slicer based on "processName" from "MIData" and works fine and shows the distinct "processName". I want to add a column "Threshold" (green text) to the matrix to show the threshold values from "MIMetrics" by Status and matching "processName".

My current dashboard page resembles this:

Slicer Selection
Process1

 

StatusCountPct of TotalAverage Transaction TimeThreshold
Referred622.20%00:04:2200:03:00
Completed1244.40%00:02:4700:05:00
OnHold933.30%00:05:2800:07:00

 

I cant seem to find a way to create that "Threshold" column in the matrix visual that only shows the value from the related "MIMetric" table. Any help would be highy appreciated.

1 ACCEPTED SOLUTION
v-echaithra
Community Support
Community Support

Hi @Fuzz_ZA ,

Thank you for reaching out to Microsoft Community.

Create a DAX Measure for Threshold, we need a measure that will return the correct threshold value from MIMetrics, depending on:

The selected processName via slicer,

The itemStatus shown in the matrix row.

Threshold Time =
VAR selectedStatus = SELECTEDVALUE(MIData[itemStatus])
VAR thresholdTime =
SWITCH(selectedStatus, "Completed", MAX(MIMetrics[Completed]),
"Referred", MAX(MIMetrics[Referred]),"OnHold", MAX(MIMetrics[OnHold]),
BLANK())
RETURN
thresholdTime

Hope this helps.
Warm Regards,
Chaithra E

View solution in original post

3 REPLIES 3
v-echaithra
Community Support
Community Support

Hi @Fuzz_ZA ,

Thank you for reaching out to Microsoft Community.

Create a DAX Measure for Threshold, we need a measure that will return the correct threshold value from MIMetrics, depending on:

The selected processName via slicer,

The itemStatus shown in the matrix row.

Threshold Time =
VAR selectedStatus = SELECTEDVALUE(MIData[itemStatus])
VAR thresholdTime =
SWITCH(selectedStatus, "Completed", MAX(MIMetrics[Completed]),
"Referred", MAX(MIMetrics[Referred]),"OnHold", MAX(MIMetrics[OnHold]),
BLANK())
RETURN
thresholdTime

Hope this helps.
Warm Regards,
Chaithra E

This is exactly what I did in the end using SWITCH() but took me a while to figure it out. It's like you read my mind 🙂 Marking yours as "Accepted Solution".

FBergamaschi
Solution Sage
Solution Sage

What is this Threshold? Do we need to calculate  it or is it available in a column (I cannot find it in your data)?

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.