Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

DAX. Projections appear empty or incorrect. Attachment pbix

Good.

I attach an image and comment.

I have an array made up of codes and when displaying its date, each date has a "IMPORTE_POSICION" with a value and in the event that the position is approved, an amount is indicated in "SIGNED". I need to create a simple projection with these two conditions:
If "SIGNED" is different from €0.00, enter the amount "SIGNED".

If "SIGNED" is equal to €0.00, put the average of the "SIGNED"

If "SIGNED" is empty, put "IMPORTE_POSICION"

Aguirre_0-1710839815391.png

I've tried several measurements, but I can't get what I want, the two that appear are:

Projection =
WERE SignedAmount =
CALCULATE(
SUM('data'[importe_posicion]),
'data'[signed] <> 0,
VALUES('data'[signed])
)
WERE AverageSignedZero =
CALCULATE(
AVERAGE('data'[importe_posicion]),
'data'[signed] = 0
)
RETURN
IF(
AmountSigned <> BLANK(),
AmountSigned,
AverageSignedZero
)
---------
I've been calculating step by step to check that everything is correct but I can't do it with these three measures either:
SignedAmount =
SUMX(
VALUES('Data'[code]),
CALCULATE(
SUM('Data'[importe_posicion]),
'Data'[signed] <> 0,
VALUES('Data'[signed])
)
)
AverageSignedZero =
CALCULATE(
AVERAGE('Data'[importe_posicion]),
'Data'[signed] <> 0
)
Projection2 =
CALCULATE (
IF (
[SignedAmount] <> 0,
[SignedAmount],
IF (
[SignedAmount] = 0,
[AverageSignedZero]
)
)
)

I'm attaching the file, in case someone can explain to me, because I don't get the correct result, I put an image of how it would be done in excel:

https://www.dropbox.com/scl/fi/pd0xvwtfruoaqbuqm0w6d/proyeccion.zip?rlkey=ucnx92snxjip4dixc2ze40omo&...

Aguirre_1-1710840550651.png

2 REPLIES 2
Anonymous
Not applicable

HI @Syndicate_Admin,

Measure expressions are calculated based on its row and filter contents. So if you want to invoke them in other formula, you need to reproduce the current row contents group and filter effects.

You can try to create a variable table with summarize function to reproduce the current row contents.

Measure Totals, The Final Word 

Regards,

Xiaoxin Sheng

Buenas Xiaoxin Sheng.

Thank you very much for your reply. Could you give me an example?

Best regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.