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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

The measure it's showing a wrong row by row values when it's added to the table

Hello guys,

I'm new in powerBI and Im' facing a problem. 

Please help!

The X column is a calculated column that I drag it to the table (the sum is enabled) and it's doing the sum of the values basing on the selected Month (Less then or equal to slicer) -> it's working fine

 

The column Y and Z are a measures, they sould sum the values where the month is = selectedMonth (Not less then or equal)

I used this formula for the Y and Z column :

 

Y= var selectedMonth=CALCULATE(max(tabMonthNB]),ALLSELECTED(tab[MonthNB])) 
var selectedYear=SELECTEDVALUE(tab[YearNB]) return CALCULATE(sum(tab[YColumn]),tab[MonthNB]=selectedMonth, tab[YearNB]=selectedYear)
 
The problem is with the Y and Z columns, the row by row information is showing values for the month 8 but they should not show a values for this month sence I have no data for July(for YColumn and ZColumn)
The total measure is correct it's 0 but the detail is showing values.
 
I will appreciate any ideas. Thanks

 


Help.png

1 ACCEPTED SOLUTION
shugh
Frequent Visitor

The issue is with crossfiltering. You should create a date table (and create a relationship to your tab table) and filter to max month using the date table. The measure would then look something like this:

 

Y=
VAR selectedMonth = SELECTEDVALUE(date[Month]) 
VAR selectedYear = SELECTEDVALUE(date[Year])
RETURN CALCULATE(SUM(tab[YColumn]),date[Month]=selectedMonth, date[Year]=selectedYear)

View solution in original post

2 REPLIES 2
shugh
Frequent Visitor

The issue is with crossfiltering. You should create a date table (and create a relationship to your tab table) and filter to max month using the date table. The measure would then look something like this:

 

Y=
VAR selectedMonth = SELECTEDVALUE(date[Month]) 
VAR selectedYear = SELECTEDVALUE(date[Year])
RETURN CALCULATE(SUM(tab[YColumn]),date[Month]=selectedMonth, date[Year]=selectedYear)
Anonymous
Not applicable

Thank u so much for your quick response.

This helped me a lot.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.