The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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]
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
33 | |
20 | |
16 | |
15 |
User | Count |
---|---|
56 | |
50 | |
36 | |
35 | |
31 |