Transfer Dax Formula into PowerQuery M-Language so I can exclude from Power Desktop

forrestgump

New Member
Joined
Sep 30, 2010
Messages
22
Hi all,

I have the following dax code which i want to transfer to power query so i can exclude certain rows before they get to Power Bi desktop:

Code:
FilterMostRecentSurvey = 
IF (
    SurveyData[Report date]
        = CALCULATE (
            LASTDATE ( SurveyData[Report date] ),
            FILTER ( ALL ( SurveyData ), SurveyData[ID] = EARLIER ( SurveyData[ID] ) )
        ),
    "IN",
    "OUT"
)
The issue is how do i write this in Power Query?
 

VBA Geek

MrExcel MVP
Joined
Dec 16, 2013
Messages
2,857
You would need to create a step where you group SurveyData by ID and return the MAX date
Then perform a inner join between the un-grouped table and the grouped table
Then Expand the table column and check if the dates are the same
 

Forum statistics

Threads
1,078,365
Messages
5,339,768
Members
399,323
Latest member
letitiaysk

Some videos you may like

This Week's Hot Topics

Top