Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Kinley1
Frequent Visitor

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 3
v-jingzhang
Community Support
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. 

vjingzhang_0-1673934661932.png

 

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.

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 

Idrissshatila
Super User
Super User

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.