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

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

Reply
Possibilitis
Frequent Visitor

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

@Possibilitis , 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

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
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