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
PBIUWO
Helper III
Helper III

Is it possible to Filter in a calculated SUMMARIZE table?

Hi,


General Question:
If I have a data source that is a excel files in folder, and has appended data from multiple dates, and has an additional column with date of the file. 

When using the "SUMMARIZE" dax to create a table, can I add a filter on the data from a column?

ex.  = SUMMARIZE(FILTER('SAMPLE', MAX('SAMPLE'[COLUMN]), COLUMN 1, COLUMN 2...) 

 

on my end, it doesn't seem to filter and just keeps all the data from the source and summarizes it all. 


Specific example: 

 

I am working on a project where I have 3 separate data tables. 

 

1 of them is called "Open Orders", and is saved everyday. In the table, it contains a column with the "Date of File", which is when the file is saved.

The 2nd one is a "Inventory Count Data" table, where it contains the Inventory Count information and the column "Date of the Count"

 

Here's what I want it to do: 

Within the visuals, after selecting the Slicer, "Date of Count" that I want to see. In the Table Visual, I want to only show the "Open Orders" rows that are the closest to the date of the "Inventory Count Data[Date of Count]". 

 

To get this:
So I did a DateDiff, between the SelectedValue (Date of the Count) and Open Orders[Date of File].

I figured out what is the smallest datediff values in a column. 

 

I am trying to create a new table using the dax Summarize from this "Open Orders" table that is only the rows that contain the smallest datediff values.

 

OPEN ORDERS SUMMARIZED = SUMMARIZE(FILTER('OPEN ORDERS', MAX('OPEN ORDERS'[DATE DIFF])), COLUMN1, COLUMN 2, SUM(QTY) )

 

This does not filter, and contains data from all the dates. 

 

 

 

 

1 ACCEPTED SOLUTION
PBIUWO
Helper III
Helper III

I solved it on my own.

 

Relatively easy, I forgot that I am using the "Group By" in the dax. 

So I referenced the date in the Group By and added wrapped the whole calculation with Filter(), and was able to bring in the GroupBy in the argument. 

View solution in original post

1 REPLY 1
PBIUWO
Helper III
Helper III

I solved it on my own.

 

Relatively easy, I forgot that I am using the "Group By" in the dax. 

So I referenced the date in the Group By and added wrapped the whole calculation with Filter(), and was able to bring in the GroupBy in the argument. 

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.