Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.
Hi all,
I have a dataset with date column and fund retun values. For a given a fund we might have a few years of history or a few months. I need a measure to return the earliest return value from the last year.
Assume for a given Fund we have a single return per day.
If the fund has historical data in the dataset prior to 1/1/2019 then I need the return value for 1/1/2019, but if the earliest data is from lets say 6/20/2019 then I need the return value for that date.
I would appreciate your help in DAX formula
Hi @Anonymous
If you've fixed the issue on your own please kindly share your solution. if the above posts help, please kindly mark it as a solution to help others find it more quickly.thanks!
Make sure you have date calendar map to your Table and Try
Last YTD Sales = CALCULATE(min(Transaction[Date]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Last YTD complete Sales = CALCULATE(min(Transaction[Date]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last YTD complete Sales = CALCULATE(min(Transaction[Date]),filter(all('Date'),year('Date'[Date]) =year(today())-1))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Perhaps:
Measure =
VAR __Fund = MAX('Table'[Fund])
VAR __Date = MINX('Table',[Date])
RETURN
MAXX(
FILTER(
'Table',
'Table'[Fund] = __Fund &&
'Table'[Date] = __Date
),
[Return]
)
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
74 | |
70 | |
70 | |
45 | |
41 |
User | Count |
---|---|
51 | |
47 | |
32 | |
28 | |
27 |