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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Dorian_scr
New Member

File based calculation query

Hello

I created a database made up of CSV. The files are all combined into a single table. I have in this table, calculated some differences between some columns however since my files are combined this calculate between all the data of all the files. I would like to be able to restrict these calculations to only data that comes from the same file. To do this, I will need to add a filter at the start of my formulas to matches the lines that have the file name in common (the first column of my table).

I performed all my calculations in Power Query and I don't find how to filter.

 

here a example of a line :

([S3_MS] - List.Min(#"Type modifié1"[S3_MS]))/1000)

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@Dorian_scr If I understand correctly, I could do so in the auxiliary query. There must be a 'Transform sample file' query or something similar that works with each CSV file by itself - add the List.Min column to that query, this will be transferred to the merged table, but it will calculate the value of each table separately without having to filter or group or anything else.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

3 REPLIES 3
AllisonKennedy
Super User
Super User

@Dorian_scr If I understand correctly, I could do so in the auxiliary query. There must be a 'Transform sample file' query or something similar that works with each CSV file by itself - add the List.Min column to that query, this will be transferred to the merged table, but it will calculate the value of each table separately without having to filter or group or anything else.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Exactly what I was looking for, thanks !

lbendlin
Super User
Super User

Please provide sample data in usable format and show the expected outcome.  This could be done with grouping or a list aggregator.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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