Forum Discussion

sbone's avatar
sbone
Frequent Visitor
8 years ago
Solved

Pass Parameter Values to Calculated Table Created in M

All,   I'm using Andrew Todd's fantastic M query (below) to create a mortgage table on-the-fly in Power BI. I need to be able to let a user pass the key variables (p, i, and n) from a Power BI repo...
  • Greg_Deckler's avatar
    Greg_Deckler
    8 years ago

    Yes, you could create 3 measures for P, i and n. Then, you could create a new table using the New Table under the Modeling tab of the ribbon. You will need to use GENERATESERIES.

     

    I may have time to give you the exact answer later on tonight if I do not have too many beverages. I've already had several so no guarantees. But essentially, you would create a table with GENERATESERIES to create your initial table. The rest should be just adding columns to that table using the same basic math as in the Power Query code. You could refer to your measures in your code.

     

    GENERATESERIES

    https://msdn.microsoft.com/en-us/library/mt842624.aspx

     

    Note that I also ponder whether or not a static table is really the most suitable vehicle for whatever it is that you are solving or whether a dynamic table would be better suited to the ultimate goal of what you are trying to achieve. But, I do not understand your ultimate goal, I assume it involves some version of taking over the world, but specifics would help. Unless it compromises your ultimate goal of world domination and in that case, I understand if you want to be cagey about things.