Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Urgent calculate value same column

Hi all!

 

I need to calculate the value of the state "in progress" for each ID by checking if the state column has "in progress" and "prioritized", otherwise I will not return anything. In this case below should return to ID 11 = 0 (contains only "in progress") and ID 8737 = 5 (contains "in progress" and "prioritized").

 

Could you please help me using DAX?

 

Work Item IdValueState
111025In Progress
1169Done
11 New
8737 New
87372Approved
87371Prioritized
87375In Progress
873714Done
1 ACCEPTED SOLUTION

I used the same formula you created and getting 0 for 11

link for pbix : https://www.dropbox.com/s/jcvon4c9pg7za52/WorkItem.pbix?dl=0

 

Screenshot 2019-11-13 13.58.55.png

 

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

Use concatenatex and search

 

https://docs.microsoft.com/en-us/dax/concatenatex-function-dax

https://docs.microsoft.com/en-us/dax/search-function-dax

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Anonymous
Not applicable

I tried the DAX below but unfortunately it only worked for id 8737 which has both states (prioritized and in progress), but in id 11 it should show 0 since it only has in progress. What should I do? Thank you again!

 

FEATURE WAITING =

VAR _state = CALCULATE(CONCATENATEX('MEDIAS STATUS';'MEDIAS STATUS'[State];" ");ALLEXCEPT('MEDIAS STATUS';'MEDIAS STATUS'[Work Item Id]))

VAR _value= CALCULATE(AVERAGE('MEDIAS STATUS'[STATE_INTERVAL]);'MEDIAS STATUS'[State]="In Progress")

RETURN

IF((SEARCH("In Progress";_state;1;0)+SEARCH("Prioritized";_state;1;0))>=2;_value;0)

 

 

Work Item IdStateValue
11Done1025
11In Progress1025
11New1025
8737Approved5
8737Done5
8737In Progress5
8737New5
8737Prioritized5

I used the same formula you created and getting 0 for 11

link for pbix : https://www.dropbox.com/s/jcvon4c9pg7za52/WorkItem.pbix?dl=0

 

Screenshot 2019-11-13 13.58.55.png

 

Anonymous
Not applicable

I tried again and now it works. Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.