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
Kay_Kalu
Helper I
Helper I

Dax for matrix table

I have this table image below 

Kay_Kalu_0-1755164827161.png

Lookin to create a matrix table below 

Kay_Kalu_1-1755164993734.png

Total Checking Parent Count = Distinct count of unique checking_parent/JIRA_ID where the checking parent matches the "Checking Parent" column on this table

Total SQL Feedback = ( (Distinct count of unique checking_parent/JIRA_ID/feedback category = "SQL" /Item_ref where the checking parent matches the "Checking Parent" column on this table) 

Total SQL No Feedback = ( (Distinct count of unique checking_parent/JIRA_ID where the checking parent matches the "Checking Parent" column on this table) * (SQL Weighting for the "Checking Parent" colmun in the "Task Weighting" tab) ) - Minus cases from the "Total Feedback" column

If I could be helped with DAX for this calculation it will help.  

2 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@Kay_Kalu , Use

dax
TotalCheckingParentCount =
CALCULATE(
DISTINCTCOUNT('YourTable'[JIRA_ID]),
'YourTable'[checking_parent] = 'YourTable'[Checking Parent]
)

 

dax
TotalSQLFeedback =
CALCULATE(
DISTINCTCOUNT('YourTable'[Item_ref]),
'YourTable'[checking_parent] = 'YourTable'[Checking Parent],
'YourTable'[feedback_category] = "SQL"
)

 

dax
TotalSQLNoFeedback =
VAR TotalCheckingParent =
CALCULATE(
DISTINCTCOUNT('YourTable'[JIRA_ID]),
'YourTable'[checking_parent] = 'YourTable'[Checking Parent]
)
VAR SQLWeighting =
LOOKUPVALUE(
'TaskWeighting'[SQLWeighting],
'TaskWeighting'[Checking Parent], 'YourTable'[Checking Parent]
)
VAR TotalFeedback =
[TotalSQLFeedback]
RETURN
(TotalCheckingParent * SQLWeighting) - TotalFeedback

 

dax
SQLFailRate =
DIVIDE(
[TotalSQLFeedback],
[TotalSQLNoFeedback],
0
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

alish_b
Impactful Individual
Impactful Individual

Hello @Kay_Kalu ,

Thank you for the sample data.

Please find the DAX below:

Total SQL Feedback = 
VAR FilteredTable =
    FILTER (
        FeedbackData,
        FeedbackData[feedback category] = "SQL"
    )
VAR DistinctPerJira =
    SUMMARIZE (
        FilteredTable,
        FeedbackData[jira_id],
        "DistinctItems", DISTINCTCOUNT ( FeedbackData[item_ref] )
    )
RETURN
SUMX ( DistinctPerJira, [DistinctItems] )

Now I loaded the sample data as a table called 'FeedbackData' so please update it with your table name and make adjustments as required.

I have structured the query in sequential blocks so it is easy to understand. First we filter the table for only feedback category = "SQL" (since we are interested in SQL Feedback). Next, we calculate the distinct count of item_ref  for each jira_id and finally sum that up. One assumption I took here is that you don't need this checking_parent = Population Review Check as a hard coded filter rather this will be provided at say row level in visual and needs to be dynamic (if it needs to be static, you can simply add it after the feedback category= 'SQL' condition as

&& FeedbackData[checking_parent] = "Population Review Check")

alish_b_0-1755173279817.png

Hope it helps!

View solution in original post

8 REPLIES 8
Kay_Kalu
Helper I
Helper I

please could you help with this part

Total SQL No Feedback = ( (Distinct count of unique checking_parent/JIRA_ID where the checking parent matches the "Checking Parent" column on this table) * (SQL Weighting for the "Checking Parent" colmun in the "Task Weighting" tab) ) - Minus cases from the "Total Feedback" column

If I could be helped with DAX for this calculation it will help.

Checking ParentSQL WeightingBusiness WeightingProcess Weighting
Population Review Check327
Data Fix Driver File Checking123
P&C Request Checking014
CS/Suspense Handover Checking105
Bespoke Datafix Spec Checking004
Sweep Docs Checking233
Review Signoff206
Calc Flag Review Signoff205
Totals11837

Attached is the Task Weighting table. so it uses the weight "SQL Weighting" when the iteam_ref is SQL and so on. the checking_parent will be row filtered 

Kay_Kalu
Helper I
Helper I

Thanks This works 👍

alish_b
Impactful Individual
Impactful Individual

Awesome @Kay_Kalu !

 

Happy to help!

bhanu_gautam
Super User
Super User

@Kay_Kalu , Use

dax
TotalCheckingParentCount =
CALCULATE(
DISTINCTCOUNT('YourTable'[JIRA_ID]),
'YourTable'[checking_parent] = 'YourTable'[Checking Parent]
)

 

dax
TotalSQLFeedback =
CALCULATE(
DISTINCTCOUNT('YourTable'[Item_ref]),
'YourTable'[checking_parent] = 'YourTable'[Checking Parent],
'YourTable'[feedback_category] = "SQL"
)

 

dax
TotalSQLNoFeedback =
VAR TotalCheckingParent =
CALCULATE(
DISTINCTCOUNT('YourTable'[JIRA_ID]),
'YourTable'[checking_parent] = 'YourTable'[Checking Parent]
)
VAR SQLWeighting =
LOOKUPVALUE(
'TaskWeighting'[SQLWeighting],
'TaskWeighting'[Checking Parent], 'YourTable'[Checking Parent]
)
VAR TotalFeedback =
[TotalSQLFeedback]
RETURN
(TotalCheckingParent * SQLWeighting) - TotalFeedback

 

dax
SQLFailRate =
DIVIDE(
[TotalSQLFeedback],
[TotalSQLNoFeedback],
0
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Thanks TotalCheckingParentCount  worked fine but I guess for the TotalSQLFeedback i haven't explained it well so below is a sample explained. thanks

 

jira_iditem_refcomment_datechecking_parentfeedback category
PPDQ-9506PR118/07/2025 16:52Population Review CheckSQL
PPDQ-9387PR101/07/2025 16:17Population Review CheckSQL
PPDQ-9387PR201/07/2025 16:17Population Review CheckSQL
PPDQ-9350PR116/06/2025 17:24Population Review CheckSQL
PPDQ-9225PR120/05/2025 17:21Population Review CheckSQL
PPDQ-9225PR101/07/2025 13:54Population Review CheckSQL

 

From the table above I have filtered the feedback category = "SQL" and checking_parent = Population Review Check then the count to get Total SQL Feedback will be distinct count of Item_ref in relation to the jira_id. e.g PPDQ-9387 will count as 2 but PPDQ-9225 will count as 1

alish_b
Impactful Individual
Impactful Individual

Hello @Kay_Kalu ,


Please provide some sample data in a format that can be copied (instead of a screenshot or image). That will help us to understand your requirement better and cook up a solution for your needs.

jira_iditem_refcomment_datechecking_parentfeedback category
PPDQ-9506PR118/07/2025 16:52Population Review CheckSQL
PPDQ-9387PR101/07/2025 16:17Population Review CheckSQL
PPDQ-9387PR201/07/2025 16:17Population Review CheckSQL
PPDQ-9350PR116/06/2025 17:24Population Review CheckSQL
PPDQ-9225PR120/05/2025 17:21Population Review CheckSQL
PPDQ-9225PR101/07/2025 13:54Population Review CheckSQL

 

From the table above I have filtered the feedback category = "SQL" and checking_parent = Population Review Check then the count to get Total SQL Feedback will be distinct count of Item_ref in relation to the jira_id. e.g PPDQ-9387 will count as 2 but PPDQ-9225 will count as 1

alish_b
Impactful Individual
Impactful Individual

Hello @Kay_Kalu ,

Thank you for the sample data.

Please find the DAX below:

Total SQL Feedback = 
VAR FilteredTable =
    FILTER (
        FeedbackData,
        FeedbackData[feedback category] = "SQL"
    )
VAR DistinctPerJira =
    SUMMARIZE (
        FilteredTable,
        FeedbackData[jira_id],
        "DistinctItems", DISTINCTCOUNT ( FeedbackData[item_ref] )
    )
RETURN
SUMX ( DistinctPerJira, [DistinctItems] )

Now I loaded the sample data as a table called 'FeedbackData' so please update it with your table name and make adjustments as required.

I have structured the query in sequential blocks so it is easy to understand. First we filter the table for only feedback category = "SQL" (since we are interested in SQL Feedback). Next, we calculate the distinct count of item_ref  for each jira_id and finally sum that up. One assumption I took here is that you don't need this checking_parent = Population Review Check as a hard coded filter rather this will be provided at say row level in visual and needs to be dynamic (if it needs to be static, you can simply add it after the feedback category= 'SQL' condition as

&& FeedbackData[checking_parent] = "Population Review Check")

alish_b_0-1755173279817.png

Hope it helps!

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.