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
jalaomar
Helper IV
Helper IV

Issue with data wrong on row level when no filter applied but correct when applying filter

Dear all,

 

I am stuck with an issue with my data and not sure how to proceed.

I have a table with all projects and in this table we capture monthly snapshots related to sales , budget. I have created measures using SUMX function an example below

SALES PRICE = SUMX(VALUES(TABLE[Project]); [Sales Price])
 
I have noticed that I am getting wrong totals because a few projects capture data for a specific month even though in the query there is no data for that month. seems like for some reason PBI takes to account cost from previous month for those specific projects.
 
in the table when I have the full portfolio of projects I can see the cost that shouldn't be there but when I filter on these specific projects the sales price shows correctly. see table below so see the behavior for one of these projects 
 
I have tried all versions of SUMX including date ranges but nothing seems to be working 
Date Project Sales localSales Hard
AprilA63100
MayA0100
    
PBI report  when applying date filter to May
    
Date Project Sales localSales Hard
MayA63100
1 ACCEPTED SOLUTION
Akash_Varuna
Super User
Super User

Hi @jalaomar It might be because SUMX aggregates across rows without proper filter context. Modify your measure to explicitly filter by the current date for example like CALCULATE([Sales Price], TABLE[Date] = MAX(TABLE[Date])). Ensure the Date field is included in the visualization or model filters. 

View solution in original post

6 REPLIES 6
rohit1991
Super User
Super User

Hi @jalaomar

 

The issue comes from the way your measure is written:

SALES PRICE = SUMX( VALUES(Table[Project]), [Sales Price] )

Here [Sales Price] doesn’t respect the date filter, so when a month has no data (e.g. May), Power BI still pulls values from earlier months, which makes totals look wrong unless you apply a project/date filter.

 

Could you please try below steps:

Make sure your measure is constrained by both Project and Date. For example:

Sales Price =
CALCULATE(
    SUM(Table[Sales_Price]),
    KEEPFILTERS( VALUES('Date'[Date]) )
)

 

If your Date table isn’t directly related to the snapshot column, use TREATAS:

Sales Price =
CALCULATE(
    SUM(Table[Sales_Price]),
    TREATAS( VALUES('Date'[Date]), Table[SnapshotDate] )
)

 

Also check your visual: turn off “Show items with no data” if you don’t want blank months to display.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
Anonymous
Not applicable

Hi @jalaomar,

Thanks for reaching out to the Microsoft fabric community forum.

From what you’ve described, it seems the problem is related to how the SUMX measure is iterating over the list of projects, especially in months where no data exists for some of them. Power BI doesn’t automatically exclude projects just because there’s no data for the selected month, if those projects exist in the model or relationship structure, they’ll still be evaluated, and the measure might end up pulling values from a previous period if the logic allows it.

This would explain why you’re seeing values like 63 for Project A in May, even though your underlying data clearly shows a 0. When you filter down to just that specific project, the context becomes more focused and behaves as expected but when looking at the full list of projects, Power BI may still iterate through others and apply unexpected context from earlier months.

One thing worth double-checking is how the [Sales Price] measure is written. If it doesn’t explicitly filter for the current month or doesn’t handle missing data carefully, it might return values from other periods. Also, consider whether the data model includes all months and all project-month combinations, even if they have 0 values. If some rows are missing entirely, Power BI can't filter on what's not there.

As a next step, I will recommend you to:

* Verify that the [Sales Price] measure respects the current date/month context.

* Also check if your data source includes zero rows for all project-month combinations.

* Or you can modify the measure to ensure it returns blank instead of carrying forward values from previous periods.

 

I would also take a moment to thank @Akash_Varuna, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference

 

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

Best Regards,
Hammad.
Community Support Team

 

If this post helps then please mark it as a solution, so that other members find it more quickly.

Thank you.

Anonymous
Not applicable

Hi @jalaomar,

As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.

If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.


If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you for your patience and look forward to hearing from you.

Anonymous
Not applicable

Hi @jalaomar,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.


Thank you.

Anonymous
Not applicable

Hi @jalaomar,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

Akash_Varuna
Super User
Super User

Hi @jalaomar It might be because SUMX aggregates across rows without proper filter context. Modify your measure to explicitly filter by the current date for example like CALCULATE([Sales Price], TABLE[Date] = MAX(TABLE[Date])). Ensure the Date field is included in the visualization or model filters. 

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.