Forum Discussion
Issue with Summarizing Status Count
- 8 years ago
Hi rocky09,
Based on my test, the formula below should work in your scenario.
Count = VAR maxDate = CALCULATE ( MAX ( Data[Date] ), FILTER ( ALL ( Data ), Data[Cat.] = EARLIER ( Data[Cat.] ) ) ) VAR minDate = CALCULATE ( MAX ( Data[Date] ), FILTER ( ALL ( Data ), Data[Cat.] = EARLIER ( Data[Cat.] ) ) ) RETURN IF ( Data[Status] = "Completed", 1, IF ( Data[Date] = maxDate, 1 + DATEDIFF ( minDate, maxDate, DAY ) / 10, 0 ) )Here is the sample pbix file for your reference. :smileyhappy:
Regards
I have older version of excel. So, I cannot see the measure you used in the excel. That is why i have asked you to provide pbi file.
Hi,
Surprisingly, when i import the Excel workbook contents into PowerBI desktop, i get a message saying that a table of multiple values was supplied where a single value was expected. I get the perfect solution in Excel though. Here is the calculated field formula i wrote
=IFERROR(COUNTROWS(FILTER(VALUES(Data[Cat.]),CALCULATE(LOOKUPVALUE(Data[Status],Data[Date],MAX(Data[Date])),ALL(Data[Status]))=VALUES(Data[Status]))),BLANK())
- rocky098 years agoSolution Sage
Hi Thank you,
Now, i am getting error "A table of multiple values was supplied where a single value was expected."
- Ashish_Mathur8 years agoSuper User
Hi,
That is exactly what i mentioned in my previous post. I get the same error. It works fine in Excel though. Looks like a bug in PowerBI desktop.
- rocky098 years agoSolution Sage
oh.. will wait for someone to confirm if this is the actually bug with Power Bi Desktop as it is working fine in Excel. Weired.