cancel
Showing results for 
Search instead for 
Did you mean: 
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

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

4 REPLIES 4
amitchandak
Super User IV
Super User IV

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

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

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Anonymous
Not applicable

I tried again and now it works. Thank you!

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power BI User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.