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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Translate DAX query into M query

Hi,

 

Can anyone help me to translate DAX query into M query.

I'm new to M query, need to implement this measure at M query.

 

SUM =
VAR A =
SWITCH(MONTH(SELECTEDVALUE(Ships[Fiscal Month])),3,-6,2,-5,1,-4,12,-3,11,-2,10,-1,9,-6,8,-5,7,-4,6,-3,5,-2,4,-1)
RETURN
CALCULATE(SUM(Ships[Shipments]),DATESINPERIOD(Ships[Fiscal Month],SELECTEDVALUE(Ships[Fiscal Month]),A,MONTH))

 

Thanks In Advance.

 

Regrads,

Pavan Vanguri.

1 REPLY 1
v-danhe-msft
Employee
Employee

Hi @Anonymous,

Could you please tell me the formula is a measure or a calculated column, I tried with the formula as calculated column, but it returns blank and if it is a measure, I am afraid you could not achieve the result. Could you please post me your desired result or share the pbix file if possible?

1.PNG

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.