Forum Discussion

mattcarter865's avatar
4 years ago
Solved

Field Parameters - Error when converting from live connection to directquery

I know it's preview feature so there are bound to be bugs; That's why I'm bringing it up here.

 

I set up a Field Parameter list of measures in a shared published dataset. Then I create a thin report with a live connection to it. Field parameters work fine.

Then I change the thin report to use DirectQuery over PBI Datasets and AS connection, and the field parameter no longer works.

 

It seems this is caused by the fact that the JsonExtendedProperty on the fields column of the field parameter table does not propogate through to the local model when you switch it to DirectQuery. If you use Tabular Editor to add that property back in, it works again.

Field Parameters in Tabular Editor – Dobbs On Data

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi mattcarter865 ,

     

    Thanks for sharing.

     

    Best Regards,

    Jay

  • agusmba's avatar
    agusmba
    Advocate III

    Hi Anonymous.

     

    I'm suffering Matt's same problem with PBI Desktop (november 2022) (Composite model againsts two published PBI datasets with field parameters, not working in the new report).

    Do you know if this issue is being worked on?

    Or should I just try Matt's workaround with Tabular Editor?

     

    BTW, the "JsonExtendedProperty on the fields column of the field parameter table" is not present in the original published model, maybe the internals have changed?

    NVM, I was not seeing the extended properties in TE. Kudos mattcarter865 for posting the workaround!

     

    Thanks!

       Agustín.

  • Hi all,

    Seems this is still an issue with PowerBi June 2025.  I no longer have access to Tabular Editor.  Hoping someone might be aware of a workaround that doesn't involve Tabular Editor?  I have raised a support incident to Microsoft either way.

    Kind regards,

     

    Ben.

    • agusmba's avatar
      agusmba
      Advocate III

      First of all, thanks for replying to this thread. I had completely forgotten about this and today I needed to fix a composite model with this workaround. Serendipity.

       

      As for your question, have you tried saving your report in project mode (with TMDL enabled)? I usually do that (in order to version it with git), and I see the extendedProperty ParameterMetadata in normal models. Maybe you can add it to your composite model that way (work on a copy of the report first).

       

      This is how it looks like on the one I fixed today. I did it with TE, but I see the changes in the tmdl file after saving as project:

       

      Note that external changes to the tmdl code are not reflected on an open report, you need to reopen it in order to see the changes. You could also try the new TDML view for live editing within PBIDesktop, but I haven't tried it.

      • bhalicki's avatar
        bhalicki
        Helper V

         

         

        Hi agusmba ,

        Absolute legend!  I tried using the new TDML editor and this worked.

        The only requirement was to add the 'extendedProperty' option to the parameter field.
        Before:column Value
        dataType: string
        isHidden
        lineageTag: 39c0ff18-d51e-4b7d-aacd-742881dfae3f
        sourceLineageTag: 7a80ce5f-661c-4b34-a956-2a22137b3d6b
        dataCategory: Uncategorized
        summarizeBy: none
        sourceColumn: Value
        sortByColumn: SortOrder

        annotation SummarizationSetBy = User

        After:

        column Value
        dataType: string
        isHidden
        lineageTag: 39c0ff18-d51e-4b7d-aacd-742881dfae3f
        sourceLineageTag: 7a80ce5f-661c-4b34-a956-2a22137b3d6b
        dataCategory: Uncategorized
        summarizeBy: none
        sourceColumn: Value
        sortByColumn: SortOrder

        extendedProperty ParameterMetadata = {"version":3,"kind":2}

        annotation SummarizationSetBy = User


        After applying the changes, the parameter was recognised correctly.

        I ended up raising this to Microsoft support.  This was the response:

        We have checked with our team and found that this error occurs when a report with field parameters is renamed or changed, and the live connection is switched to direct query.

         

        This is expected behavior as the field parameters do not work in Direct Query mode.

        Users can re-create the field parameters locally on the model as a workaround.

        Please check the document below:

        Use report readers to change visuals (preview) - Power BI | Microsoft Learn

         

        As it is a limitation, it would not be possible to check this issue with our product team.

        So, we request you to please post your idea in the idea forum.

         

        To post an idea for future development

        https://community.fabric.microsoft.com/t5/Fabric-Ideas/idb-p/fbc_ideas


        For anyone who comes across this issue, just add the extendedProperty option.

        Kind regards,

        Ben.

        agusmba