Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I have a table with 2 dates and a few measurements:
| Date 1 | Date 2 | Measuremente |
| 01/01/2023 | 12/01/2022 | 10 |
| 01/02/2023 | 01/01/2023 | 23 |
| 01/03/2023 | 02/01/2023 | 45 |
I want a dynamic X-axis, so I created a Field Paramenter with Date 1 and Date 2:
| Date 1 | Date 2 | Measuremente |
| 01/01/2023 | 12/01/2022 | 10 |
| 01/02/2023 | 01/01/2023 | 23 |
| 01/03/2023 | 02/01/2023 | 45 |
Day 2 selected
| Date 1 | Date 2 | Measuremente |
| 01/02/2023 | 01/01/2023 | 23 |
| 01/03/2023 | 02/01/2023 | 45 |
Appreciate your help.
Solved! Go to Solution.
Thank you all
I was able to solve this issue by using the following tutorial.
https://blog.enterprisedna.co/working-with-multiple-dates-in-power-bi/
Thank you all
I was able to solve this issue by using the following tutorial.
https://blog.enterprisedna.co/working-with-multiple-dates-in-power-bi/
Hi @LucianoB_ ,
You can create a measure as a visual-level filter.
Measure =
SWITCH (
SELECTEDVALUE ( Parameter[Parameter Fields] ),
"'Table'[Date 1]", IF ( YEAR ( MAX ( 'Table'[Date 1] ) ) = 2023, 1 ),
"'Table'[Date 2]", IF ( YEAR ( MAX ( 'Table'[Date 2] ) ) = 2023, 1 )
)
Put this measure into the filters, set up show items when the value is 1.
Here're the results.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much @Anonymous, I realy appreciate your help.
That worked very well with the full date, however I am using Month on the Paramenter Field ('Table'[Date 1].[Month]), and the filter is returning blank.
I took your sample file and added a 2nd Parameter:
Parameter2 = {
("[Date 1].[Month]", NAMEOF('Table'[Date 1].[Month]), 0),
("[Date 2].[Month]", NAMEOF('Table'[Date 2].[Month]), 1)
}
Here are the results:
This is what I am trying to achive:
Thank again for your help.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |