Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Greetings,
I'm trying to create a conditional measure that sums up all "stage 1" values only if "stage 3" has a value for the row item.
The data below is of sample source data, but when importing the data, I have unpivot the Stage 1 through to Stage 3 columns.
| Item | Stage 1 | Stage 2 | Stage 3 |
| 1 | 100 | 100 | 100 |
| 2 | 100 | 100 | 100 |
| 3 | 100 | 100 | |
| 4 | 100 |
What sort of measure is best to calculate this?
Thanks in advance!
Solved! Go to Solution.
It would be easier if we could see the data as it exists in the tabular table. But if I understand your issue correctly the following psuedo code should work
= SUMX( table1 ,
IF( calculate(SUM(table1[Value]) , table1[Stage] = "Stage 3) > 0 ,
IF( table1[Stage] = "Stage 1", table1[Value] )
)
)
Hi @rgtanna ,
Please also try this one.
Measure 2 = VAR hasStage3Items = CALCULATETABLE ( VALUES ( Table1[Item] ), Table1[Stage] = "Stage 3" ) RETURN CALCULATE ( SUM ( Table1[Value] ), FILTER ( Table1, Table1[Item] IN hasStage3Items && Table1[Stage] = "Stage 1" ) )
Best Regards,
Hi @rgtanna ,
Please also try this one.
Measure 2 = VAR hasStage3Items = CALCULATETABLE ( VALUES ( Table1[Item] ), Table1[Stage] = "Stage 3" ) RETURN CALCULATE ( SUM ( Table1[Value] ), FILTER ( Table1, Table1[Item] IN hasStage3Items && Table1[Stage] = "Stage 1" ) )
Best Regards,
It would be easier if we could see the data as it exists in the tabular table. But if I understand your issue correctly the following psuedo code should work
= SUMX( table1 ,
IF( calculate(SUM(table1[Value]) , table1[Stage] = "Stage 3) > 0 ,
IF( table1[Stage] = "Stage 1", table1[Value] )
)
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 71 | |
| 66 | |
| 33 | |
| 32 | |
| 32 |