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.
I have a table in Power BI that contains the same values multiple times in a column, but I want to create a formula that says if any row in the column contains the same Control Name, and Status is equal to "Complete-Fail" and Discussed is equal to "Discussed with Mgmt" then make my new Effective/Ineffective column say "Ineffective", if not then "Effective" is returned. Keep in mind, every control will not have the same number of phases and not everything with a "Complete-Fail" status is Discussed with Mgmt. If you took, my sample data, I would only expect to see "Ineffective" for rows that say "Complete-Fail" and "Discussed with Mgmt."
Every control will have a Walkthrough phase while the other phases for each control will vary, so perhaps a formula can be built around if the control contains string "Complete" for the Walkthrough phase of a control, to find just one for that control that may contain "Complete-Fail" and "Discussed with Mgmt" for the Ineffective status.
Solved! Go to Solution.
Hi,
Please check the below image and the attached pbix file.
Or, please draw how the expected result looks like.
effective/ineffective CC =
VAR _condition =
COUNTROWS (
FILTER (
data,
data[control name] = EARLIER ( data[control name] )
&& data[status] = "complete-fail"
&& data[discussed] = "discussed with Mgmt"
)
) >= 1
RETURN
IF ( _condition, "ineffective", "effective" )
Hi,
Please check the below picture and the attached pbix file.
It is for creating a calcualted column.
effective/ineffective CC =
VAR _condition = data[status] = "complete-fail"
&& data[discussed] = "discussed with Mgmt"
RETURN
IF ( _condition, "ineffective", "effective" )
Thank you, but for example, CBT-05 has one phase with Complete-Fail and Discussed with Mgmt, so I want every line that says CBT-05 to read as Ineffective or just use the Walkthrough phase row only to look at every phase for each control and put Effective/Ineffective on the walkthrough phase row (based on all phases) since every control has a walkthrough phase.
Hi,
Please check the below image and the attached pbix file.
Or, please draw how the expected result looks like.
effective/ineffective CC =
VAR _condition =
COUNTROWS (
FILTER (
data,
data[control name] = EARLIER ( data[control name] )
&& data[status] = "complete-fail"
&& data[discussed] = "discussed with Mgmt"
)
) >= 1
RETURN
IF ( _condition, "ineffective", "effective" )
This resolved it. Thank you!
var controlName = datum[Control Name]
var ineffective =
FILTER(
ALL( datum ),
datum[Control Name] = controlName
&& datum[Status] = "Complete-Fail"
&& datum[Discussed] = "Discussed with Mgmt"
)
return
IF( ISEMPTY( ineffective ), "Effective", "Ineffective" )
I tried using the formula, but received an error.
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
19 | |
12 | |
9 | |
7 |