Forum Discussion

Quynhtran's avatar
Quynhtran
Regular Visitor
4 years ago
Solved

The '<pii>ColumnName</pii>' column does not exist in the rowset.

Hi everyone,

I've created a power BI report from a file saved in Sharepoint. The report will be refresh everymonth.

The report contains many columns (i.e Dec'2021, Jan'2022, Feb'2022, Mar'2022.. ). When a new month in coming, the previous month will be delected (Dec'2021) and the current month (Jan2022) will be used for the visualization. 

I dont refer Dec'2021 in any where in M query. I use its position instead (It always is the 1st value in the Month'Year list extracted from column header).

The issue is when the data auto refresh in Power BI service (I use Power Automate flow to trigger PBI data refresh when a file modified in Sharepoint), it gets error (The '<pii>Dec'2021</pii>' column does not exist in the rowset), but when I download the pbix file, the refresh runs smoothly. 

Is there any way to fix this issue?. I does not want to manually download pbix file and then re-publish it every month.

Many thanks,

Quynh.

 

  • bcdobbs's avatar
    bcdobbs
    4 years ago

    I'd explore option 1 in that case. It'll be worth the time in the long run.

7 Replies

  • arvindsingh802's avatar
    arvindsingh802
    Icon for Community Champion rankCommunity Champion

    Please refer change datatype step in your query, you will find Dec'2021 there

    • Quynhtran's avatar
      Quynhtran
      Regular Visitor

      Thanks for your quick attention. I also checked that area. I've only changed datatype for some specific columns, not include Dec'2021. 

  • bcdobbs's avatar
    bcdobbs
    Icon for Community Champion rankCommunity Champion

    I don't think it's an issue with you M code.

     

    The column exists in your tabular model but drops out of the data source hence the error.

     

    In your current structure there's no instant fix.

     

    Possible solutions:

     

    1) Personaly would unpivot "other columns" and rebuild data model around that.

     

    2) You could rename columns by position to Month -5, Month -4 etc (don't know how many you have!)

     

    3) You could update model using tabular editor connexted to xlma end point. It has scripting ability.

     

    3) There's some stuff on programmatically updating a model via xlma end point in C# https://www.sqlservercentral.com/blogs/power-bi-meets-programmability-tom-xmla-and-c

     

    • Quynhtran's avatar
      Quynhtran
      Regular Visitor

      Thanks for your suggestion. We have only Pro license, so using xlma end point cant work. 

      • bcdobbs's avatar
        bcdobbs
        Icon for Community Champion rankCommunity Champion

        I'd explore option 1 in that case. It'll be worth the time in the long run.