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 need help plotting a measure on a line chart with dates on the x-axis, and have the line starts with today's date.
Say, today is June 20th. Jan - May should be blank. The line should start in June, and the June value should be the cumulative total from beginning of time till June.
My data looks like this:
Project ID Forecast
001 08/16/19
002 10/15/19
003 02/06/20... etc.
The measure is as follows:
Forecast_Cumulative = if( MIN(Dates[Date]) <= CALCULATE( MAX([FORECAST_DATE]), ALL(Data)), CALCULATE( COUNT(Data[FORECAST_DATE]), USERELATIONSHIP(Dates[Date],Data[FORECAST_DATE]), FILTER(ALL(Dates), Dates[Date] <= MAX(Dates[Date]))))
The orange line in the picture is what I'm trying to plot. Thanks in advance for your help.
Solved! Go to Solution.
Hi @TD21 ,
Please refer to the following DAX query:
Forecast_Cumulative = IF ( MIN ( Dates[Date] ) <= CALCULATE ( MAX ( [FORECAST_DATE] ), ALL ( Data ) ) && MIN ( Dates[Date] ) >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ), CALCULATE ( COUNT ( Data[FORECAST_DATE] ), USERELATIONSHIP ( Dates[Date], Data[FORECAST_DATE] ), FILTER ( ALL ( Dates ), Dates[Date] <= MAX ( Dates[Date] ) ) ) )
The result will like below:
Best Regards,
Teige
Hi @TD21 ,
Please refer to the following DAX query:
Forecast_Cumulative = IF ( MIN ( Dates[Date] ) <= CALCULATE ( MAX ( [FORECAST_DATE] ), ALL ( Data ) ) && MIN ( Dates[Date] ) >= DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ), CALCULATE ( COUNT ( Data[FORECAST_DATE] ), USERELATIONSHIP ( Dates[Date], Data[FORECAST_DATE] ), FILTER ( ALL ( Dates ), Dates[Date] <= MAX ( Dates[Date] ) ) ) )
The result will like below:
Best Regards,
Teige
Hi,
Share the link from where i can download your PBI file.
Below is the link to the .pbix file. Thank you!
https://drive.google.com/open?id=1BHItfqWD99x4wuWOPoDvXRdbcM5_Hp9f
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 |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |