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.
Note the far right column is what I am trying to return.
My current code looks like this:
Solved! Go to Solution.
Hi @nickc_innova
Please refer to attached sample file with the solution
Previous Worker Value =
CALCULATE (
SUM ( 'Table'[Value] ),
TREATAS ( { 'Table'[Previous Worker] }, 'Table'[Assigned Worker] ),
ALLEXCEPT ( 'Table', 'Table'[Job Id] )
)
Hi,
I assume you want to create a calculated column.
Please check the below picture and the DAX formula.
Previous Worker Value CC =
LOOKUPVALUE (
Data[Value],
Data[Assigned Worker], Data[Previous Worker],
Data[Job ID], Data[Job ID]
)
This results in an error. "A table of multiple values was supplied where a single value was expected".
For some Jobs, the assigned worker is reported more than once with different values. So, when looking up the previous worker, we get more than one result.
... need some way to summarize values where job and assigned worker or previous worker match
Hi @nickc_innova
Please refer to attached sample file with the solution
Previous Worker Value =
CALCULATE (
SUM ( 'Table'[Value] ),
TREATAS ( { 'Table'[Previous Worker] }, 'Table'[Assigned Worker] ),
ALLEXCEPT ( 'Table', 'Table'[Job Id] )
)
@tamerj1, thank you so much! Not only did you provide a perfect solution but you also introduced me to something new. I did not know about the TREATAS function. Very interesting.
User | Count |
---|---|
15 | |
13 | |
9 | |
6 | |
6 |
User | Count |
---|---|
27 | |
19 | |
13 | |
9 | |
5 |