Forum Discussion
Count orders with specific conditions
Hi again 👋👋,
if I would like to have the three measures in one column chart, how could I do it? cause in x-axes is not possible on power BI... something like this, I would really apreciate your support 😁
- gkarlo2 years ago
Helper I
Thanks 🙏... btw I have tried to follow that you did with respect on counting the number of projects but regarding the price but I didn't have any success,
DATASAMPLE TABLE
Project | Status.
A | No Realized.
A. | Won.
B | No Realized.
C. | No Realized.
C. | Lost.
D. | No Realized.
D. | Lost.
E. | No Realized.
F | No Realized.
---------------------------
PROYECTLIST TABLE
Project | Price
A | 100€
A. |100€
B | 50€
C. | 50. €
C. | 50 €
D. |150 €
D. | 150€
E. |50€
F | 50€
So the result should be:
won projects: 100€lost projects: 200€
No realized projects: 150€
For example only I tried to change the given measure in order to sum all prices with respect on this status:
No of No Realized = COUNTROWS ( FILTER ( SUMMARIZE ( SampleData, SampleData[Project], "MaxStatus", MAX ( SampleData[StatusValue] ) ), [MaxStatus] = 1 ) )Instead of COUNTROW, I put SUMX
and for the table SampleData, I put another table that contains the price (different to the table of projects and status, but those have a linked relationship)
I don't know which is the missing step or in this case there is another way to get the revenue value. Thanks for the given time as well and I hope you may help me 🙏
- govindarajan_d2 years ago
Super User
Hi gkarlo,
Can you try like this:
No of No Realized = COUNTROWS ( FILTER ( ADDCOLUMNS( SUMMARIZE ( SampleData, SampleData[Project], "MaxStatus", MAX ( SampleData[StatusValue] ) ), "SumProject",SUMX(RELATEDTABLE(ProjectList),ProjectList[Price]) ), [MaxStatus] = 1 ) )- gkarlo2 years ago
Helper I
Thanks, I put the code but the measure show only the number of projects but not the sum of prices 😅(as the previous code),