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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
xexeu
New Member

Caculate simple formula using filter getting wrong

Hi Guys,

 

I'm new on PowerBI and I'm testing a formula that the result is getting wrong. The result is getting another filter that I didn't applied on the formula...

 

Screenshot 2021-11-23 224652.png

As we can see on day 01 is getting 130, but the right result is 129 as we can see below, the formula is getting another "tipo" on the column and sum in the result:

 

xexeu_0-1637718541307.png

 

Powerbi shoud apply the sum when the column tipo is "Backlog"

 

Anyone know why this is happing?

 

1 ACCEPTED SOLUTION

@xexeu 

 

Do you want a measure or a new column? the previous post I shared is good if you want to create a measure, if you want a new column use this:

Unflow =
CALCULATE (
    SUM ( '001_03_tblHistorica'[QTD] ),
    FILTER (
        '001_03_tblHistorica',
        '001_03_tblHistorica'[Tipo] = "Backlog"
            && '001_03_tblHistorica'[Visao] = EARLIER ( '001_03_tblHistorica'[Visao] )
    )
)

 

or just use the below one to show the value if the TIPO=Backlog:

New Column =
IF(Tipo] = "Backlog",[QTD],blank())

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

View solution in original post

7 REPLIES 7
VahidDM
Super User
Super User

Hi @xexeu 

 

Try this:

Unflow =
CALCULATE (
    SUM ( '001_03_tblHistorica'[QTD] ),
    FILTER ( '001_03_tblHistorica', '001_03_tblHistorica'[Tipo] = "Backlog" )
)

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Hi @VahidDM,

 

I've tried this one, but got another mistake as you can see bellow

 

xexeu_0-1637721531516.png

 

@xexeu 

 

Do you want a measure or a new column? the previous post I shared is good if you want to create a measure, if you want a new column use this:

Unflow =
CALCULATE (
    SUM ( '001_03_tblHistorica'[QTD] ),
    FILTER (
        '001_03_tblHistorica',
        '001_03_tblHistorica'[Tipo] = "Backlog"
            && '001_03_tblHistorica'[Visao] = EARLIER ( '001_03_tblHistorica'[Visao] )
    )
)

 

or just use the below one to show the value if the TIPO=Backlog:

New Column =
IF(Tipo] = "Backlog",[QTD],blank())

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Thanks @VahidDM, this help me a lto

AllisonKennedy
Super User
Super User

@xexeu  Can you share a screenshot of your data model relationships view please? 

 

Also, have you renamed the fields in the visual? Your visual is showing 'Inflow' but I don't see that in your DAX formula. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hi @AllisonKennedy,

 

I have only one table, because I'm testing:

xexeu_0-1637720009256.png

 

The field Inflow is a new column with that formula above.

 

Thanks for the help

@xexeu 

 

You'll have much more success and flexibility if you get the Power BI star schema, but for now, start by doing Inflow as a new MEASURE not column and see if that helps.

 

Resource for star schema when you're ready: https://excelwithallison.blogspot.com/2020/08/its-complicated-relationships-in-power_92.html 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.