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?
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

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
 

Watch MrExcel Video

Forum statistics

Threads
1,090,481
Messages
5,414,799
Members
403,543
Latest member
Tonkytonk

This Week's Hot Topics

Top