Forum Discussion
How to reference a column in a Power BI Measure
- Anonymous2 years ago
Hi amitchandak ,thanks for the quick reply, I'll add further.
Hi AlvinLy ,
Regarding your question, please modify your dax expression.
End Period Date = VAR _a = SELECTEDVALUE(FactTable[Schedule Date]) RETURN IF(ISBLANK(_a),BLANK(),MINX(FILTER('DateTable','DateTable'[Date] >= _a),[Date]))This is my understanding: the schedule time for 'Sleep' is filtered by the slicer to null. later you use it as a condition for filtering the date table, and since it's null, it doesn't filter any data. So it returns the smallest date in the date table. As long as the result of the measure is not null, it will not be automatically omitted by Power BI.
Hello Amitchandak
Thank you for your suggestion. I get the same result. I'm beginning to wonder if it's because I have a DirectQuery rather than an imported model that I come up with this issue, but it is odd since I think the formula that I have is rather simple.
Other than SELECTEDVALUE, MAX, and MIN, what are other typical ways we would select the column in the same row using a measure?
I assume the logic to either MAX or MIN is that during the row context of the calculation there is only one value so it chooses that value regardless if it's MAX or MIN. That makes sense in my mind, but not sure why it's not working.
Hi amitchandak ,thanks for the quick reply, I'll add further.
Hi AlvinLy ,
Regarding your question, please modify your dax expression.
End Period Date =
VAR _a = SELECTEDVALUE(FactTable[Schedule Date])
RETURN IF(ISBLANK(_a),BLANK(),MINX(FILTER('DateTable','DateTable'[Date] >= _a),[Date]))
This is my understanding: the schedule time for 'Sleep' is filtered by the slicer to null. later you use it as a condition for filtering the date table, and since it's null, it doesn't filter any data. So it returns the smallest date in the date table. As long as the result of the measure is not null, it will not be automatically omitted by Power BI.