Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to create a measure that will count items that only have a single status. For example in the table below I am looking to only count InProgress items, Base2 would be excluded as it was InProgress but then tranisitioned to Aborted. Using CALCULATE(COUNTROWS will give an answer of 3 as it will count Base1,Base2,Base3 as having a status of InProgress
Item | State |
Base1 | InProgress |
Base2 | InProgress |
Base2 | Aborted |
Base3 | InProgress |
Solved! Go to Solution.
Hi @anon23131213123 ,
How about this:
Here the DAX:
MeasureCountStatus = VAR _helpTable = SUMMARIZE ( Table, Table[Item], "countNotInProgress", CALCULATE ( DISTINCTCOUNT ( Table[State] ), Table[State] <> "InProgress" ), "countInProgress", CALCULATE ( DISTINCTCOUNT ( Table[State] ), Table[State] = "InProgress" ) ) RETURN CALCULATE ( COUNTROWS ( FILTER ( _helpTable, [countNotInProgress] = 0 && [countInProgress] = 1 ) ) )
Let me know if this works for you 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
Hi @anon23131213123 ,
How about this:
Here the DAX:
MeasureCountStatus = VAR _helpTable = SUMMARIZE ( Table, Table[Item], "countNotInProgress", CALCULATE ( DISTINCTCOUNT ( Table[State] ), Table[State] <> "InProgress" ), "countInProgress", CALCULATE ( DISTINCTCOUNT ( Table[State] ), Table[State] = "InProgress" ) ) RETURN CALCULATE ( COUNTROWS ( FILTER ( _helpTable, [countNotInProgress] = 0 && [countInProgress] = 1 ) ) )
Let me know if this works for you 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
That worked thanks!
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
13 | |
11 | |
9 | |
6 |