Forum Discussion

Kinley1's avatar
Kinley1
Frequent Visitor
3 years ago

power query

Hi all, can you help me please.

I am trying to use calculated column to show latest month report when they upload the new .xlsx files in my sharepoint folder online.

 

Latest Month = 'Sample'[Date] = CALCULATE(
    MAX('Sample'[Date])
    , FILTER(ALL('Sample')
    , 'Sample'[Country] = EARLIER('Sample'[Country]))
)
 
But I am unable to find my table. It always shows this error: " Cannot find table 'Sample'. 
I am trying to map Date with Country column

3 Replies

  • Hello Kinley1,

     

    try it like this:

     

    Latest Month = CALCULATE(
    MAX('Sample'[Date])
    , FILTER(ALL('Sample')
    , 'Sample'[Country] = EARLIER('Sample'[Country]))
    )

     

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

     

    Follow me on Linkedin

  • Kinley1's avatar
    Kinley1
    Frequent Visitor

    Hello Idrissshatila 

     

    Query still cannot find my sharepoint online folder 'Sample'. The error reads "Cannot find table 'Sample'"

     

    Is there any way to how we put sharepoint folder in the power queries 

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi Kinley1 

     

    In which table did you add this calculated column? Do you have a table named as "Sample" in your model?

     

    If you have a table named as "Sample" and add a calculated column in this table, you will have below result. Is this what you want? Please note that this formula is DAX formula not Power Query. 

     

    If you want to load data from a sharepoint folder, please refer to Combining Excel Files hosted on a SharePoint folder with Power BI | Microsoft Power BI Blog

     

    If you only want to load data from the newest file into your model, you need to filter that in Power Query Editor. After that, you have to refresh data to import the latest data from the sharepoint folder. 

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.