Forum Discussion
neillago
5 years agoRegular Visitor
Help with DAX CALCULATE returning incorrect blanks
Hello, I am having trouble getting my measure to work. I am using DirectQuery on a streaming Power BI dataset. A sample of the data looks like this: [Table] DateTime MillNo ErrorCode...
v-luwang-msft
5 years agoCommunity Support
Hi neillago
Try the following step to get what you need:
Step1,use the following dax to create the max time column:
Measure:maxtime1 = var maxtime =calculate(MAX('Table'[DateTime]),FILTER(ALL('Table'),'Table'[MillNo]=max('Table'[MillNo]))) return maxtime
Column: maxtime = 'Table'[maxtime1]
Step2,use the following dax to get what you want:
_lastJobError = CALCULATE(MAX('Table'[ErrorCode]),FILTER(ALL('Table'),'Table'[DateTime]='Table'[maxtime]&&'Table'[MillNo]=MAX('Table'[MillNo])))
Click here to download pbix if you need.
Best Regard
Lucien Wang
neillago
5 years agoRegular Visitor
Hi,
My problem is that I cannot create a calculated column as I am using Direct Query to get data in real time. I have to use a measure.