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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Static Segmentation Question

 

pbi.PNGHi - I was reading the post about this technique from https://www.daxpatterns.com/static-segmentation/ and am hoping someone could explain the syntax of the FILTER function. 

Specifically, why is it that 'Ranges' is the table in FILTER and not 'Sales' which is the table with the rows that we're iterating over? Basically, my question is why is the syntax not: 

FILTER(
           Sales,
           Sales[Price] >= Ranges[Min Price]&&
           Sales[Price] < Ranges[Max Price]

Thanks so much!



1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

Have you solved your problem?

 

If you have solved, please accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please feel free to ask.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

Have you solved your problem?

 

If you have solved, please accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please feel free to ask.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
TomMartens
Super User
Super User

Hey,

 

you have to consider what the calculation want to achieve ...

 

The fact "sales" table should be able to be sliced by the price range.

This requires a "calculated column" in the fact table that contains a value from the range table.

 

Due to the fact that the calculation "happens" in the fact table, the values of the current row from sales table can be usesd within the condition of the FILTER part.

This in combination with the iteration over Ranges (FILTER is an iterator) allows to use the references to both tables without any Aggregation function).

An iteration over the Sales table would also result to an error, because the Ranges reference can not be resolve to a single value.

 

Another smaller detail (one of the mysterious of VALUES), if the returning table just contains one row, this row will be transformed into a scalar (a single value) if needed. This is necessary because a calculated column expects a value and not a table. For this reason the usage of VALUES also "detects" errors in the configuration of the ranges, overlapping,

 

Guess, this is one the DAX statements, that despite it's less number of components, raises a lot of questions (at least it should, if one tries to fully understand DAX).

 

Hopefully this answer adds some additional insight.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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