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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

Converting Dax from PowerBI Desktop to M langue in the a datamart

Hi folks , 

I need your help. 

 

I have code which was written in DAX (PowerBI Desktop), but I need to convert it in Power Query in PowerBi Services to be used on a datamart. Below is the code : 

 

Parameter1 = GENERATESERIES(0, [Current Period], 1) on the Parameter table

Measure1 = SELECTEDVALUE('Parameter'[Parameter1]) on the Parameter table

 

The problem I have is that , [Current Period] is a measure created in datamart using another table, it is not available in Parameter table . It is not available in Transformation View. This means that I cannot use it to create a calculated field/colums "Parameter1" in the Transformation View. 

I managed to create  Parameter1 = GENERATESERIES(0, [Current Period], 1) as measure in the datamart , but I get an error when I try to reuse it  while I am creating the Measure1 = SELECTEDVALUE('Parameter'[Parameter1]). 

 

I get the following error : 

 

Column 'Parameter1' in table 'Parameter' cannot be found or may not be used in this expression. Alhtought I have created it  as a measure. 

 

I tried to use the following approach and i am getting pretty much the same error : 

 

Measure1 = SELECTEDVALUE(GENERATESERIES(0, [Current Period], 1)). 

 

Question : does anyone knows how  I can achieve this what was wording in DAX in destop and do it in DAX and PowerQuery in PowerBi Services? 

 

Thanks for your help.

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , You use List.Numbers to generate series of numbers

Power Query- List.Numbers: https://youtu.be/7_4V_Om-FEk

 

Selectedvalues only work in a measure, so you have to create a measure

Measure1 = SELECTEDVALUE('Parameter'[Parameter1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks for replying . I know that because I have used it for another parameter. The issue with this one is that , I cannot create it in powerQuery because it uses  "[Current Period]" as a max  but [Current Period] is a measure  which is not available in PowerQuery. Is there anyways I reuse a measure in powerQuery? That's the issue I am trying to solve.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.