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.
I have a csv data source that is just really a log file. Each row contains a date and then the totals from another system in various other columns (Date, Total Hours, Total Students,) etc. The file is written each day in the early morning. I have been successful in showing data just for today but I would like to also show data from this day, last year. I am relatively new to this and cannot figure it out.
Hi,
I assure the table you imported from CSV looks like below.
You can create a calculated column to get last year sam day’s value.
lastYearTotals = var
lastYear = DATEADD(logInfo[date], -1, year)
return
LOOKUPVALUE(logInfo[totals], logInfo[date], lastYear)
This is the result:
Best Regards
Alex
@gmlhawkins There are a couple ways this can be done. Firstly you will need to create a date table, see the post below where I spoke about this:
http://community.powerbi.com/t5/Desktop/Noob-Date-question/m-p/38881#
Once you have this date table you then create a relationship to the CSV file you have through the date column. Then you can use DAX formulas such as SAMEPERIODLASTYEAR
Are the CSV files you get always in the same format, i.e. the columns are always the same? If so then you can keep them all in one folder and use the get data / folder option in Power BI desktop and this will join them all together.
Thanks,
Giles
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |