The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello All,
I need help with a DAX formula (or using variables) to solve a data quality scoring issue. Here's the situation:
I have a static table called "Parent Table" that contains:
I also have a query from a database that returns data with:
Mapped names
Original names
I want to:
Threshold
Calcualation for quality scores.
Solved! Go to Solution.
Hi @Tarun_B ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @burakkaragoz for the prompt response.
I have tried replicating the scenario using sample data.Please go through the attached PBIX file for your reference.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
Hi @Tarun_B ,
I hope this information is helpful.If this answers your question, please accept it as a solution,so other community members with similar problems can find a solution faster.
Thank you.
Hi @Tarun_B ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @Tarun_B ,
I want to check if you had the opportunity to review the information provided and resolve the issue.If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @Tarun_B ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @burakkaragoz for the prompt response.
I have tried replicating the scenario using sample data.Please go through the attached PBIX file for your reference.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
I have tried all the solution provided by Chatgpt and Copilot. It give me the error
"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."
The mapped table contains unique values created through merge queries in Mquery.
Requirement: When the average quality score is 92.30% (highlighted in pink) and does not meet the threshold, it should be flagged for debugging. The threshold indicator should be red instead of green.
Hi @Tarun_B ,
Great question! Here’s how you can approach your data quality scoring problem in DAX, based on your scenario:
To ensure you’re grouping/averaging by the logical table (regardless of whether it’s the mapped or original name), create a calculated column in your data table that resolves to the “Parent Table Name” for each row.
Suppose:
You can add a calculated column in your data table:
ResolvedTableName = VAR FoundMapped = LOOKUPVALUE( 'Parent Table'[Parent Table Name], 'Parent Table'[Mapped Table], [Table Name] ) RETURN IF( NOT(ISBLANK(FoundMapped)), FoundMapped, [Table Name] // fallback to original )
Create a measure:
AvgQualityScore = AVERAGEX( VALUES('DataTable'[ResolvedTableName]), CALCULATE(AVERAGE('DataTable'[DataQualityScore])) )
(Adjust for your actual field names.)
Assuming you have a threshold table with columns: [Parent Table Name], [Threshold Score]
Create a measure for color indicator:
DQ_Status = VAR TableName = SELECTEDVALUE('DataTable'[ResolvedTableName]) VAR AvgScore = CALCULATE(AVERAGE('DataTable'[DataQualityScore]), 'DataTable'[ResolvedTableName] = TableName) VAR Threshold = LOOKUPVALUE('ThresholdTable'[Threshold Score], 'ThresholdTable'[Parent Table Name], TableName) RETURN IF(AvgScore >= Threshold, "Green", "Red")
Summary:
If you need a sample PBIX or run into issues with the DAX, let me know the exact table/column names and I can help you write out the full formulas!
Hope this helps!
User | Count |
---|---|
71 | |
64 | |
62 | |
50 | |
28 |
User | Count |
---|---|
117 | |
75 | |
62 | |
55 | |
43 |