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

Next 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

Reply
mmahachi2
Regular Visitor

super simple calculate not showing correctly in power bi table

HI - Please help so I know I'm not losing my mind, I've been working with DAx for years now and for some reason I can't understand why it is giving me a value against Opex when I have exclusivly applied a filter in caluclate to not sum Opex rows 

 

mmahachi2_0-1698226809515.png

 

My DAX is simply: 

Cash Disbursements YTD = CALCULATE (
    SUM ( Netsuite[Debit] ), Netsuite[Budget Source]="Capex")
 
what am I missing to ensure it does not show a value on the Opex line? 
 
thank you in advance

 

 

 

1 ACCEPTED SOLUTION
Uzi2019
Super User
Super User

Hi @mmahachi2 

 

Please try the below measure:

Cash Disbursements YTD = CALCULATE (
    SUM ( Netsuite[Debit] ), Filter ('Netsuite', Netsuite [Budget Source]="Capex"))
 
You can also try with Value function
 
SUM ( Netsuite[Debit] ), Filter (VALUE('Netsuite'), Netsuite [Budget Source]="Capex"))

This both will give you  a desired result.

If my post helps Please give kudos and accept it as a solution!
Thanks
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

6 REPLIES 6
mmahachi2
Regular Visitor

thank you that worked using the filter - but is that new I was sure i've used without filter and didn't see values for rows that were filtered out in calculate, especially if only showing fields from that single table in the visual.

Hi @mmahachi2 ,
Filter is not new. I have been using in the same scenario from last many years 🙂.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

ha! not a new function but a change in the functionality - as I don't recall needing to have the filter fundtion defined within calculate, except in the more complex scenarios like measures that may need to combine calculations across many tables for example. anyway just seemed very odd.

Uzi2019
Super User
Super User

Hi @mmahachi2 

 

Please try the below measure:

Cash Disbursements YTD = CALCULATE (
    SUM ( Netsuite[Debit] ), Filter ('Netsuite', Netsuite [Budget Source]="Capex"))
 
You can also try with Value function
 
SUM ( Netsuite[Debit] ), Filter (VALUE('Netsuite'), Netsuite [Budget Source]="Capex"))

This both will give you  a desired result.

If my post helps Please give kudos and accept it as a solution!
Thanks
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Hi @mmahachi2 
Please check the below result.

Uzi2019_0-1698231315016.png

 

I hope this is what you wanted.

If my post helps please give kudos and accept it as a solution!
Thanks

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
HotChilli
Community Champion
Community Champion

That's the classic example in https://www.sqlbi.com/articles/introducing-calculate-in-dax/ 

This is the short syntax but it really represents

CALCULATE (
    SUM(netsuite[debit],
    FILTER (
        ALL ( Netsuite[Budget Source] ),
        Netsuite[Budget Source] = "Red"
    )
)

The filter gets replace by the red filter.

--

For your required solution, you need KEEPFILTERS

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Users online (7,239)