Forum Discussion
Anonymous
6 years agoNot applicable
How To Select The Recent Value in a Day ?
Hi Guys, I am new to power BI and stuck with an issue. I have my model as follows: Date Dimension Measurement Fact The date column in date dimension is link to measuredate Below is a ...
JosefPrakljacic
6 years agoSolution Sage
Hello Anonymous
that means that my last answer with LASTNONBLANKVALUE would work.
I also created a second measure and used your measurementid as a flag for the last value.
Please look at this example file if it satisifies your needs.
If this post was helpful may I ask you to mark it as solution and give it some kudos?
Anonymous Have a nice day!
BR,
Josef
Anonymous
6 years agoNot applicable
Hi Josef,
I was unable to get your solution to work for me consistently. It worked for that small dataset I sent to you but when I connect to the whole data in the table it didn't work. I had to create two separate measures for it to work as shown below:
max_measurement_id = CALCULATE(MAX(measurement[measurementid]), FILTER(measurement, measurement[metername] = "CONSO-FUEL" )) day_fuel_consumption = var maxid = [max_measurement_id] return CALCULATE(SUM(measurement[measurementvalue]), measurement[measurementid] = maxid)
Not sure why it wants two separate measures.