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
ktdicarlo
New Member

show only the latest survey response

I need to run a report on members who have completed a survey but it must only include the member's latest response to the survey. Members have filled out the survey multiple times but I need to bring in only the answers from their most recent response.

In the example below. Member William Ross has answered the survey on both 12/03/2021 and 05/31/2022. I only need his most recent response of 05/31/2022 and need to hide any of his earlier responses.

ktdicarlo_0-1669835180328.png

 

This report should only show the latest "Assessment Date" based on the "Member ID"

 

I have tried creating a DAX function using variables but have not been successful. Please assist

 

Assessment Date Latest =
VAR LatestDate =
    CALCULATE ( MAX ( 'MHK_ACTL_Assessments'[Assessment Date] ), ALL ( 'MHK_ACTL_Program'[Member ID] ) )
RETURN
    IF ( MIN ( 'MHK_ACTL_Assessments'[Assessment Date] ) = LatestDate, 1, 0 )
 
This does not work.
2 REPLIES 2
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @ktdicarlo, Did you use a measure or calculated column?

 

The following measure should give you the date of the latest response. 

 

 

Assessment Date Latest =

VAR CurrentUser = SELECTEDVALUE('MHK_ACTL_Program'[Member ID])

VAR LatestDateOfUser =
    CALCULATE ( 
         MAX ( 'MHK_ACTL_Assessments'[Assessment Date] ), 
         'MHK_ACTL_Program'[Member ID] = CurrentUser 
    )

RETURN
    LatestDateOfUser

 

 

 Further steps depend on how you want to use it. How did you intend to use the measure you already created?

 

Best regards

Michael

-----------------------------------------------------

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!

@ me in replies or I'll lose your thread.

-----------------------------------------------------

LinkedIn

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

Hi I am trying to use a measure. I tried your measure but it caused the below issue with my dataset. I am trying to clean the dataset to eliminate unnessary data but have had no luck.

ktdicarlo_0-1670344870683.png

 

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.