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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LucaA
Helper IV
Helper IV

Make an Excel file crash at a specific date

Hi guys,

i would need to include a query (in PQ) /dax formula in (power pivot) to make a file crash at a specific date in the future.

anyone knows a way to achieve the goal?

I would not want to use additional VBA code

Thanks in advance for any suggestion

Bye 

Luca

6 REPLIES 6
v-alq-msft
Community Support
Community Support

Hi, @LucaA 

 

If you want to use the latest file, you may try to create a function in Power Query, which always loads the newest created file using folder connector.

 

First you need to create a blank query and paste the codes in 'Advanced Editor'.

 

let
    Source = (Path as any) => let
        Source = Folder.Files(Path),
        Custom1 = Table.SelectRows(Source,each [Date created]= 
    Table.Max(Source,"Date created")[Date created]
    )
    in
        Custom1
in
    Source

 

 

a2.png

 

Finally you may input the folder path to get the newest created file in the folder.

a3.png

 

Result:

a4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-alq-msft

thank you for the idea,

i will use it.

but what i can do if the file has been downloaded in local?

thanks

Luca

Anonymous
Not applicable

So you want to sabotage the file?  

Yes, something like that. I need to stop the use of an old version and be sure that anyone is using the new one at a specific date in the future.

The only way I know is using Powershell to delete this file, is this file hosted on cloud or on a drive? 

Appreciate your Kudos!

 

If I solve your problem, please accept this as a Solution

 

Add me on Linked In , Visit my blog vizcube.biz
Subscribe to my youtube channel 

spg_vizcube
Helper II
Helper II

Not sure if I get your question right, What do you mean by Crashing the excel sheet? 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors