Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
76 | |
52 | |
39 | |
35 |
User | Count |
---|---|
92 | |
66 | |
55 | |
52 | |
45 |