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

DAX Measure Error - ONLY Return MAX data if all conditions are met

Hi Experts

 

I need to correct the following DAX Measure to ONLY return back max date based three column if MEUIMSTASKID and MEUWONUM and Max Completion Date (Step 1) if Max Completion Date (Step 1) has a a zero based on MEUIMSTASKID and MEUWONUM (Grouping) then no max date if based on MEUIMSTASKID and MEUWONUM grouping are all 1 then meax completion date.

Max Completion Date (Step2) = CALCULATE(MAX('FINCNTRL - Task (AG)'[ACTFINISH]),
                    ALLEXCEPT('FINCNTRL - Task (AG)','FINCNTRL - Task (AG)'[MEUIMSTASKID],'FINCNTRL - Task (AG)'[MEUWONUM]))

apple1111_0-1674474684201.png

 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

I'm not clear about your requirement. Are the field [Max Completion Date (Step 1) ] and [ Max Completion Date (Step 2) ] fact field of the table 'FINCNTRL - Task (AG)' ? Or they are calculated columns which we need to get it finally? What's your final expected result? Do you want to display the max complation date group by MEUIMSTASKID and MEUWONUM which the [Max Completion Date (Step 1) ]  is 1, otherwise display null?

yingyinr_0-1674639278049.png

Could you please provide more raw data in your table 'FINCNTRL - Task (AG)' (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

I'm not clear about your requirement. Are the field [Max Completion Date (Step 1) ] and [ Max Completion Date (Step 2) ] fact field of the table 'FINCNTRL - Task (AG)' ? Or they are calculated columns which we need to get it finally? What's your final expected result? Do you want to display the max complation date group by MEUIMSTASKID and MEUWONUM which the [Max Completion Date (Step 1) ]  is 1, otherwise display null?

yingyinr_0-1674639278049.png

Could you please provide more raw data in your table 'FINCNTRL - Task (AG)' (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thennarasu_R
Responsive Resident
Responsive Resident

Hi @Anonymous 
try this measure,

Thennarasu_R_0-1674475306967.png

Thanks ,
Thennarasu

Anonymous
Not applicable

Hi Thennarasau_R - I need to show no date as i have 0 for the grouping MEUIMSTASKID and MEUWONUM

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.