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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors