The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
@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])
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.
User | Count |
---|---|
68 | |
63 | |
59 | |
54 | |
28 |
User | Count |
---|---|
183 | |
80 | |
62 | |
46 | |
38 |