Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I have requirement to select data from table based on 2 year-months (Jan 2019). I have created Dropdown from one table which is used for year month selections. and I have created parameter slicer to select number of months to be added.
I have created another column to add month value (Selected from slicer). I can see that value for slicer is changing but it is not changing in column calcuation.
below is derivation for calcuate target date but this is not being calcuate dynamically.
COL_DT_TGT = FORMAT(DATEADD(Uniq_year_month1[Column1].[Date], Param_Month[Param_Month Value] ,MONTH),"DD-mmm-YYYY")
I have tried converting Param_Month[Param_Month Value] to measure but same results.
Refer below image. In upper diagram 1, 2 is selected still target date it Oct (which should be april + 2 which is Jun) and 2nd diagram 4 is selected in slicer. still target date it Oct. Month is moved.
Solved! Go to Solution.
Hi @Anonymous ,
The function of DATEADD can not calculate separately. It is usually used with CALCULATE.
I created a sample to implement that a date plus a selected month using the function of DATE. You could try and check if it is what you want.
Measure =
var selected_month = SELECTEDVALUE('Parameter'[Parameter])
var ye = YEAR(MAX('Table'[Date]))
var mon = MONTH(MAX('Table'[Date]))
var day = DAY(MAX('Table'[Date]))
return
FORMAT(DATE(ye,mon + selected_month, day),"DD-MMM-YYYY")
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.
Hi @Anonymous ,
The function of DATEADD can not calculate separately. It is usually used with CALCULATE.
I created a sample to implement that a date plus a selected month using the function of DATE. You could try and check if it is what you want.
Measure =
var selected_month = SELECTEDVALUE('Parameter'[Parameter])
var ye = YEAR(MAX('Table'[Date]))
var mon = MONTH(MAX('Table'[Date]))
var day = DAY(MAX('Table'[Date]))
return
FORMAT(DATE(ye,mon + selected_month, day),"DD-MMM-YYYY")
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
105 | |
99 | |
99 | |
38 | |
37 |
User | Count |
---|---|
157 | |
121 | |
73 | |
73 | |
63 |