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 Community,
I need to right a measure that generate value based on date range. So basically i've calendar table and data input table.
Data Input
Start Date | End Date | Amount |
1/1/2020 | 12/31/2021 | 100 |
So the requirement is to put this on line chart that has periods from calendar table on x axes and we want a line shows the amount the Amount on every month within that period.
Any ideas other that building a table to spread the amounts of rows?
Solved! Go to Solution.
Hi @MoCPA ,
I suggest you to inactive or remove the relationship between the input table and calendar table. Then create a measure to filter your visual.
Filter =
VAR _START =
SELECTEDVALUE ( 'Data Input'[Start Date] )
VAR _END =
SELECTEDVALUE ( 'Data Input'[End Date] )
RETURN
IF (
MIN ( 'Calendar'[Date] ) >= _START
&& MAX ( 'Calendar'[Date] ) <= _END,
1,
0
)
Add this measure into visual level filter and set it to show items when value = 1. Result is a below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MoCPA ,
I suggest you to inactive or remove the relationship between the input table and calendar table. Then create a measure to filter your visual.
Filter =
VAR _START =
SELECTEDVALUE ( 'Data Input'[Start Date] )
VAR _END =
SELECTEDVALUE ( 'Data Input'[End Date] )
RETURN
IF (
MIN ( 'Calendar'[Date] ) >= _START
&& MAX ( 'Calendar'[Date] ) <= _END,
1,
0
)
Add this measure into visual level filter and set it to show items when value = 1. Result is a below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@MoCPA , Refer if these approches can help
Measure way
Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM
https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...
Tables way
https://amitchandak.mediumcom/dax-get-all-dates-between-the-start-and-end-date-8f3dac4ff90b
https://amitchandak.medium.com/power-query-get-all-dates-between-the-start-and-end-date-9ad6a84cf5f2
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 |
---|---|
14 | |
11 | |
10 | |
10 | |
9 |
User | Count |
---|---|
18 | |
13 | |
12 | |
11 | |
8 |