Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello everyone,
Is there any way to force DAX to calculate a constatnt line (1) between two dates? Chart below:
My current measure:
*Measure "Test1" is added to chart as line
Every time I play around with filter context (DIM_DATE) I receive a value 1 across all dates.
Thanks for any help 🙂
Solved! Go to Solution.
HI @Filip_analyst
Please try
Test2 =
VAR date1 =
MAX ( DIM_DATE[DATE] )
VAR date2 =
DATE ( 2022, 01, 05 )
VAR date2 =
DATE ( 2022, 06, 10 )
RETURN
IF ( date1 >= date2 && date1 <= date3, 1 )
HI @Filip_analyst
Please try
Test2 =
VAR date1 =
MAX ( DIM_DATE[DATE] )
VAR date2 =
DATE ( 2022, 01, 05 )
VAR date2 =
DATE ( 2022, 06, 10 )
RETURN
IF ( date1 >= date2 && date1 <= date3, 1 )
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
14 | |
12 | |
11 | |
10 | |
9 |