Forum Discussion
Need help
- 5 years ago
Hi,
I hope the below is what you are looking for.
I created a measure that gives The LATEST Rating result of the equipment among the current or from before until the current month. I also considered if one Equipment has two Ratings on the same day, then give the maximum result of Ratings, because "selectedvalue(Data[Rating])" gives blank value if it has two results.
test result (if it is not in this month, show last month result) =VAR lasttestdate =CALCULATE (MAX ( Data[Test_Date] ),FILTER ( ALL ( dates ), dates[Date] <= MAX ( dates[Date] ) ))VAR withresult =CALCULATE ( SELECTEDVALUE ( Data[Rating], MAX(Data[Rating]) ), dates[Date] = lasttestdate )RETURNwithresultThen, I created the below measure.equipment count by test result =VAR newtable =SUMMARIZE (ALL(Equipments),Equipments[Equipment],"@testresult",[test result (if it is not in this month, show last month result)])VAR filtertable =FILTER (newtable,[@testresult]= SELECTEDVALUE ( Ratings[Rating] ))RETURNIF (ISBLANK ( [count of equipment] ),BLANK (),COUNTROWS ( filtertable ))
Yes. Exactly.
Jihwan's solution also worked on the sample data but isnt working on the main data. Plus, equipment will be filtered based on system, so keeping equipment constant also doesnt help.
Hi,
Share your main data in an MS Excel file. I only need the first 3 columns in that file (not the bins column. I have solved it without the bins column). Let me plug in that data to see whether my solution get your desired result or not.
- yousaf5 years agoHelper I
Here is the link,
- Ashish_Mathur5 years agoSuper User
Hi,
Is this the result you expect to see for 2020 and Plant Z?
- yousaf5 years agoHelper I
Yes. This is correct.
- Ashish_Mathur5 years agoSuper User
Hi,
You may refer to my solution here - Determine latest condition of each equipment and show a month wise count.
Hope this helps.