Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Dunner2020
Post Prodigy
Post Prodigy

From Dax to Power Query

 

Hi there,

I am calculating a column using the above-mentioned logic in DAX:

Last 24 hr Raw SAIDI =
SUMX(
FILTER(‘Fact Table’ , ‘Fact Table’[EpochHH] >= EARLIER( ‘Fact Table’[EpochHH] ) - 47 && ‘Fact Table’[EpochHH] <= EARLIER( ‘Fact Table’[EpochHH] ) ), ‘Fact Table’[30 Mins Raw ])

I want to convert the above DAX formula into power query language. I am not sure is there any alternate for earlier and sumx functions in the query language. Could anyone help me in converting above formula into query language?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Dunner2020 ,

 

Add two custom columns

5.png6.png

 

 

Best Regards,

Stephen Tao

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Dunner2020 ,

 

Add two custom columns

5.png6.png

 

 

Best Regards,

Stephen Tao

 

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

samdthompson
Memorable Member
Memorable Member

Would you want to do create measure in power query? PQ is there to shape and tidy not do analysis. 

in saying that, yes you can with a bunch of steps. You will need some grouping and some indexing. Its worthwhile having a look at this post too, it will sort out your calculation:

Value from previous row – Power Query, M language – ExcelTown – kurzy přesně pro Vás 

 

 

// if this is a solution please mark as such. Kudos always appreciated.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors