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
DouweMeer
Impactful Individual
Impactful Individual

I'm not getting the running total intracity of inclusion of date table

As far as I get the concept of the application of filters onto the data context is that you have:

  1. Base
  2. Post relationships
  3. External
  4. Internal
  5. DAX/ measure level

Report and page filters are applied at the second level. Row context by row values in a matrix value or non-summarized values in a table visual create context on the 3rd level. Also x-axis in graphs apply at the 3rd level. For example, ALLSELECTED in 5 applies to 4. ALL applies to 1-3. HOWEVER, if at 5 by filter context of 2 no records return, all doesn't work and whatever sum/ min you apply remain to return null values, even if you do "isblank" as it is not blank, but null. That's my understanding on the context's hierarchy. 

 

For the context of my data model, I utilize a date table with a single relationship on one-to-many to my main table. 

DouweMeer_1-1705335418014.png

The relationship is not by date, but by "Id Date". Date on the other side is not always rounded. So, to make sure all records return, I round that side through a calculated column. On my date table, there's also a filter whether it is within scope of my refresh that is always on "yes" thereby creating filter context on whatever I write below. 

 

Now, if I write myself a measure like so:

(1) Calculate (
(2)  min ( 'table'[date]
(3)  , allselected ( 'table'[date] )
(4)  )

When the internal context is provided by 'table'[date], it doesn't return each time the minimum value as defined by the 3rd context's hierarchy (external).

DouweMeer_2-1705335761413.png

I presume this is because the context is not just but filtered by the date's field and doing an "all" on the field doesn't expand the context because it is not the one affected. But, if I choose to remove the date's hierarchy from the visual, it does choose to return the expected results:

DouweMeer_5-1705337327597.png

 

Even if go full mental adding whatever relevant fields there are, it still doesn't provide the appropriate context.

(5) Calculate (
(6)   min ( 'table'[date] )
(7)   , allselected ( 'table'[date] , 'table'[id date] )
(8)   , allselected ( 'date table'[date] , 'date table'[id date] , 'date table'[check] )
(9)   )

It just keeps giving me the same return values. 

DouweMeer_3-1705336270896.png

 

However, when I do apply the ALLSELECTED onto the whole of the table, it does return me what I want.

(10) Calculate (
(11)   min ( 'table'[date] )
(12)   , allselected ( 'table' )
(13)   )

You'd get:

DouweMeer_4-1705336487550.png

Why? I imagine that selecting individual fields within the 'table' table I should be able to reproduce whatever context you'd get if you'd do the ALLSELECTED on the whole table. Changing at the 12th line the 'table' table towards the 'date table' table would only work when the 4th context's hierarchy at row level is swapped from the 'table'[date] field to the 'date table[date] field. However, it would produce a value at more dates than the 'table' table when the 'date table' table is larger than the 'table' table. 

 

Why can't you seemingly reproduce the context that you'd get via:

allselected ( 'table' )

by writing something like:

allselected ( 'table'[field] , 'table'[field2] , ... )

Or lies the trouble within the phantom date tables behind the date fields containing its own context that's you can't undo by specifying individual fields but you could by selecting the whole? 

 

2 REPLIES 2
Anonymous
Not applicable

Hi @DouweMeer ,

The function ALLSELECTED returns all rows that were selected in the filter context before the current filter context was applied. This means it respects slicers and visual-level filters that are applied to the report. When is used on an entire table, it removes filters from all columns in that table but still respects the filters that were applied through slicers or other visuals.

Now, let's address the issue with your DAX measure:

If you want to reproduce the context of with specific fields, you need to include all fields that are involved in the visual or report filters. This includes both the columns used directly in the visual and any columns that are related to the visual through relationships or calculations.

Running Total Measure = 
CALCULATE (
    MIN ( 'table'[date] ),
    ALLSELECTED ( 'table' )
)

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

DouweMeer
Impactful Individual
Impactful Individual

Hey @Anonymous 

That's what I did, that's what I tried to explain. That... was what was not working. 

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.