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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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