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.
Hi, I want to calculate the cumulative values for vol and NNS columns in the screenshot. But also taking into account of the dummy column so rows that have "a" should proceed as 5-10-15 and the ones with "b" should proceed as 6-12-18 for YTD Vol column as an example. Right now my formula doesn't take the Dummy column into account and adds both a and b values for YTD. I would really appreciate If you can help me with a general solution as the screenshot is just me testing this and the real data will have multiple dummy columns and way more than 2 different values in each column.
Solved! Go to Solution.
This should work:
YTD = VAR __CurrentDate= Table1[Date] Var __CurrentDummy = Table1[Dummy] Var __CurrentYear = YEAR(Table1[Date]) Return CALCULATE( SUM( Table1[vol]), FILTER( ALL( Table1), __CurrentDate >= Table1[Date] && __CurrentDummy = Table1[Dummy] && __CurrentYear = YEAR(Table1[Date]) ) )
Ok I managed to work it, although I just have a single year in my data set so I didnt need to include anything else for other years basically.
Ok I managed to work it, although I just have a single year in my data set so I didnt need to include anything else for other years basically.
This should work:
YTD = VAR __CurrentDate= Table1[Date] Var __CurrentDummy = Table1[Dummy] Var __CurrentYear = YEAR(Table1[Date]) Return CALCULATE( SUM( Table1[vol]), FILTER( ALL( Table1), __CurrentDate >= Table1[Date] && __CurrentDummy = Table1[Dummy] && __CurrentYear = YEAR(Table1[Date]) ) )
Thanks for your answer,
I tried it many different ways but I cant have it work for some reason, Im new to DAX and I cant figure which variable's format I should be changing.
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |