Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
We're computing for the Defect Free % of our reports. Our data only goes as far as the current month but with the way the formula is structured (1 - (Reports with Defects / All Reports) ), the periods where there are no actual data pop up in our graph and show up as 100%:
Is there a way I can get this to compute only for the periods where there is actual data? Oddly enough, a blank entry also appears:
Whereas there shouldn't be any since I made the necessary filters for the page:
QAIssues is a custom column computed like so:
QAIssues =
COUNTROWS(
RELATEDTABLE('Defects')
)
~Defect % =
VAR cntDefects =
COUNTROWS(
FILTER('Audits', AND(NOT(ISBLANK('Audits'[QAIssues])), 'Audits'[QAIssues] > 0))
)
RETURN (1 - DIVIDE(cntDefects, COUNTROWS('Audits')))
Solved! Go to Solution.
Your last bit after the return
RETURN (1 - DIVIDE(cntDefects, COUNTROWS('Audits')))is evaluated to 1-blank(), which PowerBI translates to 1-0 = 1 => 100%
You can test this directly with
Minus Blank() = 1-BLANK()which also returns 1.
If you want those entries to disappear from your visual, you’ll need to add a check before the subtraction and return BLANK() whenever the denominator is empty.
For example:
~Defect % =
VAR cntDefects =
COUNTROWS (
FILTER (
'Audits',
NOT ( ISBLANK ( 'Audits'[QAIssues] ) )
&& 'Audits'[QAIssues] > 0
)
)
VAR cntAll = COUNTROWS ( 'Audits' )
RETURN
IF ( cntAll = 0, BLANK(), 1 - DIVIDE ( cntDefects, cntAll ) )
Your last bit after the return
RETURN (1 - DIVIDE(cntDefects, COUNTROWS('Audits')))is evaluated to 1-blank(), which PowerBI translates to 1-0 = 1 => 100%
You can test this directly with
Minus Blank() = 1-BLANK()which also returns 1.
If you want those entries to disappear from your visual, you’ll need to add a check before the subtraction and return BLANK() whenever the denominator is empty.
For example:
~Defect % =
VAR cntDefects =
COUNTROWS (
FILTER (
'Audits',
NOT ( ISBLANK ( 'Audits'[QAIssues] ) )
&& 'Audits'[QAIssues] > 0
)
)
VAR cntAll = COUNTROWS ( 'Audits' )
RETURN
IF ( cntAll = 0, BLANK(), 1 - DIVIDE ( cntDefects, cntAll ) )
Hi,
Share the download link of the PBI file.
Hi @olimilo
Adjust your measure so it only calculates when there are audits:
Defect Free % =
VAR denom = [Audits]
VAR defects = [Audits with Defects]
RETURN
IF ( denom = 0, BLANK(), DIVIDE ( denom - defects, denom ) )
If you prefer to explicitly show 0% in months without audits, change it slightly:
Defect Free % (zero on no-audit) =
VAR denom = [Audits]
VAR defects = [Audits with Defects]
RETURN
IF ( denom = 0, 0, DIVIDE ( denom - defects, denom ) )
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |