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.
Hello,
I need help with creating a DAX Formula. I have four columns in my table called "Transactions":
1. Date
2. Fund ID
3. Frequency
4. Dividends
And I need to write a formula that does the following:
Could someone please help me with this? I am new to DAX and am lost on whether I should use the Calculate formula, IF formula, etc.
Solved! Go to Solution.
@hawkeyes12 , let your measures be:
If this solves the problem, kindly mark my response as a solution.
Hi @hawkeyes12 , I like to break down my DAX into pieces to make it easier to write, read and understand. This is what you should write, assuming the dates start counting from today:
If this solves the problem, kindly mark my response as a solution.
Hi @ahmedoye this is very helpful! If the dates don't start counting from today and instead start counting from the most recent date in the [Date] column, how would this change the formula? For example, this calculation will be performed in mid-March and the source file will include data from 2/28/2019 to 2/29/2020. The first date that we would want included in the 30, 90 and 365 day calculation is 2/29/2020.
I am having a very hard time with the date functions so any guidance you may have is very appreciated!
@hawkeyes12 , let your measures be:
If this solves the problem, kindly mark my response as a solution.
You likely want to use a SWITCH statement. And you will likely want to calculate your value using a SUMX statement with a FILTER although you could also use CALCULATE with a FILTER statement. So either:
SUMX(FILTER('Table',....),[Dividends])
or
CALCULATE(SUM([Dividends]),FILTER(...))
Hi - thank you for the response. Could you please explain what you mean by a SWITCH Statement?
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 |
---|---|
49 | |
26 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |