Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
When I add a measure to a table, the slicers that were applied to that table are ignored. I assume this is because there is always a value in the measure, as related to this forum post https://community.powerbi.com/t5/Desktop/New-Measure-prevents-Slicer-from-working/td-p/470557, but I can't work out the formula I need.
The formaula I have is as follows. So it is looking at columns in 2 related tables. I am also not sure if SELECTEDVALUE is the right code to use here.
Measure = IF(SELECTEDVALUE('TABLE2'[Width])<5,INT(((SELECTEDVALUE('TABLE1'[Age1]))/0.5395)+0.5),INT(((SELECTEDVALUE('TABLE1'[Age1]))/0.5106)+0.5))
Can anyone help please?
Solved! Go to Solution.
Hi @tgjones43 ,
Take try of this one:
Measure = var a = MAX('Observations'[Age1])/0.5395 var b = MAX('Observations'[Age1])/0.5106 Return IF(MAX('Observation Attributes'[Width])<5&&NOT(ISBLANK(a)),INT(a+0.5),IF(MAX('Observation Attributes'[Width])>=5&&NOT(ISBLANK(b)),INT(b+0.5),BLANK()))
Hi @tgjones43 ,
Could you please share your dummy pbix? what would be easier for us to provide the valuable advice.
Hi @v-diye-msft
Please find the link to a simplified pbix file below. In creating this file I realise the issue is with the +0.5 in the measure. Remove this and the measure works fine in the table. So I just need some different code to deal with this.
Basically what the measure is doing is applying a slightly different calculation to the values in [Age1] depending on whether the value in [Width] is greater or less than 5
https://www.dropbox.com/s/0pnmaz3c5rmdrtt/SlicerMeasureExample.pbix?dl=0
Hi @tgjones43 ,
Take try of this one:
Measure = var a = MAX('Observations'[Age1])/0.5395 var b = MAX('Observations'[Age1])/0.5106 Return IF(MAX('Observation Attributes'[Width])<5&&NOT(ISBLANK(a)),INT(a+0.5),IF(MAX('Observation Attributes'[Width])>=5&&NOT(ISBLANK(b)),INT(b+0.5),BLANK()))
Thank you @v-diye-msft How can I get the measure to display 0 rather than be blank when there is no value in [Age1]?
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |