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'm pretty new to DAX and I'm trying to solve a problem.
I need to calculate the sum of Fees from the year to a date
Here is an exemple
Date 1 | Date 2 | Fees
01/2018 | 06/2018 | 5
02/2018 | 03/2018 | 3
03/2018 | 08/2018 | 14
11/2017 | 06/2019 | 21
If I pick Date 1 = 03/2018 & Date 2 = 06/2018 my result should be 8
If I pick Date 1 = 03/2018 & Date 2 = 08/2018 my result should be 22
If I pick Date 1 = 12/2017 & Date 2 = 06/2018 my result should be 21
I used this formula :
Fees = CALCULATE( SUM('Fraisdesante-20190926'[frais_base]); FILTER( ALL('Fraisdesante-20190926'[monthid_soins_date]); 'Fraisdesante-20190926'[monthid_soins_date] <= MAX('Fraisdesante-20190926'[monthid_soins_date]) ); FILTER( ALL('Fraisdesante-20190926'[monthid_soins_date]); YEAR('Fraisdesante-20190926'[monthid_soins_date]) = YEAR(MAX('Fraisdesante-20190926'[monthid_soins_date])) ); FILTER( ALL('Fraisdesante-20190926'[monthid_compt_date]); 'Fraisdesante-20190926'[monthid_compt_date] <= MAX('Fraisdesante-20190926'[monthid_compt_date]) ); FILTER( ALL('Fraisdesante-20190926'[monthid_compt_date]); YEAR('Fraisdesante-20190926'[monthid_compt_date]) = YEAR(MAX('Fraisdesante-20190926'[monthid_compt_date]))))
But when I pick the case : Date 1 = 12/2017 & Date 2 = 06/2018
the result is <Blanck>
Thanks in advance
Solved! Go to Solution.
@Anonymous
You may drag [Date] from a separate calendar table and apply virtual relationship in DAX measure.
@Anonymous
You may drag [Date] from a separate calendar table and apply virtual relationship in DAX measure.
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 |
---|---|
112 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |