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 August 31st. Request your voucher.
Hi all,
I would like to create a calculated column using DAX, titled Curriculum Status, that will apply the following logic:
The end results should look like this:
Solved! Go to Solution.
I didn't understand this part " if all course IDs in column B are mapped to the curriculum in column A " and it doesn't seem to matter for your desired result.
Curriculum Status =
var s = CALCULATETable(values('Table'[Course Status]),ALLEXCEPT('Table','Table'[User ID]))
return if(concatenatex(s,'Table'[Course Status],",")="Completed",s,"Incomplete")
=VAR _course=CALCULATETABLE(VALUES(sample[Course ID]),ALLEXCEPT(sample,sample[User ID])) VAR _curri=CALCULATETABLE(VALUES(sample[Curriculumn ID]),ALL(sample),sample[Course ID] IN _course) VAR _status=CALCULATETABLE(VALUES(sample[Course Statues]),ALL(sample),sample[Curriculum ID] IN _curri,sample[Course Status]<>"Completed") RETURN IF(COUNTROWS(_status)>0,"Incompleted","Completed")
I didn't understand this part " if all course IDs in column B are mapped to the curriculum in column A " and it doesn't seem to matter for your desired result.
Curriculum Status =
var s = CALCULATETable(values('Table'[Course Status]),ALLEXCEPT('Table','Table'[User ID]))
return if(concatenatex(s,'Table'[Course Status],",")="Completed",s,"Incomplete")
@lbendlin True. I did not really need that condition.
Thanks for the solution. Works like a charm. Much appreciated.
Please try this column expression
Status =
VAR vIncompleteRows =
CALCULATE (
COUNTROWS ( Table ),
ALLEXCEPT (
Table,
Table[User ID],
Table[Curriculum ID]
),
Table[Course Status] <> "Completed"
)
RETURN
IF (
vIncompleteRows > 0,
"Incomplete",
"Completed"
)
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
User | Count |
---|---|
27 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |