Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi friends.
I have a Calendar Table (CALENDARIO) created with the min and max of 2 columns dates ([Plan Date] and [Real Date]) from another table (HITOS), and I use it for the X axis of a Line Chart. Also I have a date Slicer (between) created with the column [Plan Date] from the same table used before (HITOS).
On the model, I have determined 2 diferent relationship between the 2 tables:
Both relationships are inactives.
So, I need a way to change the X axis of the Line Chart with the dates selected on the Slicer.
Now I have this result:
And I need this one (I have change the date filter manually):
The model:
Can anyone help me please?
Thanks!
Solved! Go to Solution.
hi @MauroBote
Just the adjust the two measure as below:
PLAN AC =
CALCULATE(
SUM(HITOS[PESO]),
USERELATIONSHIP(CALENDARIO[Date],HITOS[FECHA PLAN]),FILTER(
ALLSELECTED(CALENDARIO[Date]),MAX(CALENDARIO[Date])<=MAX(HITOS[FECHA PLAN])&&
ISONORAFTER(CALENDARIO[Date], MAX(CALENDARIO[Date]), DESC)
)
)/HITOS[Total % PESO]
Result:
Regards,
Lin
hi @MauroBote
You need to just make some changes in the formula of the two measure.
Please share your sample pbix file for us to have a test, that will be a great help.
Regards,
Lin
hi @MauroBote
Just the adjust the two measure as below:
PLAN AC =
CALCULATE(
SUM(HITOS[PESO]),
USERELATIONSHIP(CALENDARIO[Date],HITOS[FECHA PLAN]),FILTER(
ALLSELECTED(CALENDARIO[Date]),MAX(CALENDARIO[Date])<=MAX(HITOS[FECHA PLAN])&&
ISONORAFTER(CALENDARIO[Date], MAX(CALENDARIO[Date]), DESC)
)
)/HITOS[Total % PESO]
Result:
Regards,
Lin
Thank you so much Lin. You are a genius!!!
REfer
plan =
var _min = minx(CALENDARIO,CALENDARIO[Date])
return
calculate(sum(HITOS[Plan Value]),filter(CALENDARIO,CALENDARIO[Date]>=_min &&CALENDARIO[Date]<=max(CALENDARIO[Date]))
,userelation(HITOS[Plan Date] , CALENDARIO[Date]))
actual =
var _min = minx(CALENDARIO,CALENDARIO[Date])
return
calculate(sum(HITOS[Real Value]),filter(CALENDARIO,CALENDARIO[Date]>=_min &&CALENDARIO[Date]<=max(CALENDARIO[Date]))
userelation(HITOS[Real Date] , CALENDARIO[Date]))
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.