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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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