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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Applicable88
Impactful Individual
Impactful Individual

Difference of a naked column in a calculated column or filter() of a measure

Hello,

 

Measure 1 =
calculate([TotalSales]),
Filter(
ALL('Calendar'[Date]),
'Calendar'[Date]<= MAX('Calendar'[Date])
))
in this Measure 1 above I need to wrap up Calendar[Date] within a aggregation like MAX and somehow it finds the filter context to calendar date. It is actually inside the filter of a interator. If I just write [CalendarDate] I get only the total sum in every row.
 
But writing the same as a naked colum in a calculated column, which by itself is already an row by row iterator I get right values:
Column= 
Var _TableVariable= Filter( 'Calendar', 'Calendar' [Date]>'Maintable'[BookingDate] && 'Calendar[Day]= "Monday"))
return
countrows(_TableVariable) 
 
Here I don't need any aggregator I can just write naked column and when computing every row it knows which date and values to fill in. But in the Measure it's also in a row to row context via Filter-Function, why here I cannot use naked column?
 
Thank you very much in advance.
 
Best. 
 
2 REPLIES 2
amitchandak
Super User
Super User

@Applicable88 , You are returning a table from filter. just like measure column can only have one value per row.

So calculation should be done assuming each row operation happens. here you are returning a table for each row

 

example

if( 'Calendar' [Date]>minx(relatedtable('Maintable') , 'Maintable'[BookingDate]) && 'Calendar[Day]= "Monday",1,0)

 

assuming Maintable is joined with calendar

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak I understand what you mean. But I'm referring to the Filter function, which you can see in the measure and also in the calculated column. In the measure 'Calendar'[Date] only works with MAX('Calendar'[Date])  whereas in the calculated column in works with a naked column like 'Calendar'[Date]>= 'Booking'[Date] 

I assume you have row by row also in the measure through Filter(), so why cannot write                'Calendar'[Date]<= 'Calendar'[Date] instead? Don't we have row context here ? Why we need to aggregate? It's a virtual table within the measure in my understanding, same as filter() in a calculated column.

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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