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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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