The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have 2 columns. Week Number and Value so my data look like this
Week | Value |
5 | 4445 |
6 | 36 |
7 | 335 |
8 | 6 |
9 | 44 |
10 | 1414 |
I have a slicer for Week number. What Im trying to do is take the maximum value selected on the slicer. So for example if the user selected the maximum value of the slicer to be 8 I want to take this value and subtract 2 out of it. and then create another measure to check if this number = the week number then return a yes else return a no.
The measures I created:
Week | Value | measure test |
5 | 4445 | no |
6 | 36 | yes |
7 | 335 | no |
8 | 6 | no |
9 | 44 | no |
10 | 1414 | no |
But its returning a "no" for all fields. And I realized that its not taking the max value of the selected slicer - 2 and compare it with all records, rather its subtracting 2 from every record and then compare it with the original number of that record before subtracting a 2.
Your help is highly appriciated.
Thank you!
Solved! Go to Solution.
Hi @Anonymous ,
We can use the following steps to meet your requirement:
measure test =
var select_slicer = SELECTEDVALUE('Table 2'[Week])
var week_2 = select_slicer-2
return
IF(week_2 = max('Table'[Week]) , "Yes","No")
BTW, pbix as attached.
Best regards,
Hi @Anonymous ,
How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?
Best regards,
Hi @Anonymous ,
We can use the following steps to meet your requirement:
measure test =
var select_slicer = SELECTEDVALUE('Table 2'[Week])
var week_2 = select_slicer-2
return
IF(week_2 = max('Table'[Week]) , "Yes","No")
BTW, pbix as attached.
Best regards,
User | Count |
---|---|
75 | |
70 | |
40 | |
30 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
50 | |
46 |