Forum Discussion
New user needs help with DAX
- Anonymous2 years ago
Hi, KrilleGTI
Based on your information, I create a table
Then I create a new measure named Average value by date
Based on your requirements, I've created a measure, and here's a preview of me
Here is my DAX
Measure = var a=MAXX(FILTER(ALLSELECTED('Table'),[Date]<MAX('Table'[Date])),[Date]) var b=CALCULATE([Average value by date],'Table'[Date]=MINX(ALLSELECTED('Table'),[Date])) RETURN DIVIDE([Average value by date],b)-1How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, KrilleGTI
Based on your information, I create a table
Then I create a new measure named Average value by date
Based on your requirements, I've created a measure, and here's a preview of me
Here is my DAX
Measure = var a=MAXX(FILTER(ALLSELECTED('Table'),[Date]<MAX('Table'[Date])),[Date])
var b=CALCULATE([Average value by date],'Table'[Date]=MINX(ALLSELECTED('Table'),[Date]))
RETURN DIVIDE([Average value by date],b)-1
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Works perfect, Thanks!