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

Replicating Dax in Power Query

Hello, 

 

I need to replicate this DAX formula in Power Query, as I need to remove the blank rows, However my DAX calculated collum doesnt appear in the Query Editor. 

 

New Collum =

VAR LatestDate =


MAXX(FILTER('EmployeeJobs','EmployeeJobs'[empid] = EARLIER(EmployeeJobs[empid])),EmployeeJobs[datefrom])


RETURN IF('EmployeeJobs'[datefrom] = LatestDate ,EmployeeJobs[empid], BLANK())

 

I'd Appreciate any advice

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hello both, 

 

Thanks for your responses, I managed a work around which solves my problem. 

 

Thanks

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hello both, 

 

Thanks for your responses, I managed a work around which solves my problem. 

 

Thanks

 

dax
Community Support
Community Support

Hi Howardd, 

You could refe to below Mcode to see whether it work or not.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTIyMLTUN9Q3VIrVQRIwQhcwhgoYwQRMMQXMwQLGCAETVAFDA31TVBEzkCGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [id = _t, date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"id", Int64.Type}, {"date", type date}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"id"}, {{"MAX", each List.Max([date]), type date}, {"ALL", each _, type table [id=number, date=date]}}),
    #"Expanded ALL" = Table.ExpandTableColumn(#"Grouped Rows", "ALL", {"date"}, {"ALL.date"}),
    #"Added Custom" = Table.AddColumn(#"Expanded ALL", "Custom", each if [MAX]=[ALL.date] then [id] else null),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"MAX"})
in
    #"Removed Columns"

Best Regards,
Zoe Zhi

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

 

Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You can recreate your DAX calculated column in Power Query.

Can you provide a data sample and desired outcome?

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.


 

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.

Top Solution Authors
Top Kudoed Authors