Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The 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.

Reply
Anonymous
Not applicable

Slicer Parameters is not being calculated.

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.

 

Power BI Parameter Selection.jpg

1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

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")

7.PNG

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.

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.

View solution in original post

1 REPLY 1
v-xuding-msft
Community Support
Community Support

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")

7.PNG

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.

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.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.