cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Frequent Visitor

## Keep a legacy of a filter, filter a table dynamically

Hello!

I need some help with DAX expressions.

The context: I have a table with 3 columns: project names, efficiency in percent for each project and quarter. The table is for one year, so I have 4 quarters in quarter column. The projects are not always the same according to the quarter.

What I need is to select a quarter with a quarter slicer (let's say Q2) and see the general productivity during the year, by each quarter. But only for projects that we can see in Q2 (A and C) and not all the projects together. (For exemple, if there were 45 projects in Q2 and 50 in Q3 I need a history only about those 45).

I tried several ideas as créatin a variable with list of projects in selected quarter and comparing after this list of projects with all the projects with FILTER, ALLSELECTED and IN, but I get "columns can't be converted to scalar value" mostly for all my tries.

Should it be something like tables created with SUMMARIZECOLUMN ?

1 ACCEPTED SOLUTION
Super User

Hi,

Here is one approach to this:

Data:

Dax:

calculate quarter values = CALCULATE(COUNT('Table (9)'[Project]),MAX('Calendar'[Q])='Table (9)'[Quarter])

Note:

There is no relationship between my calendar and table (9).

Result:

When selecting Q 1-3 all projects are displayed:

When selecting Q4 P3 is disregarded in calculation since it doesn't have data on Q4:

Using this logic you should be able to create the measure you want.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

Proud to be a Super User!

Super User

Hi,

Here is one approach to this:

Data:

Dax:

calculate quarter values = CALCULATE(COUNT('Table (9)'[Project]),MAX('Calendar'[Q])='Table (9)'[Quarter])

Note:

There is no relationship between my calendar and table (9).

Result:

When selecting Q 1-3 all projects are displayed:

When selecting Q4 P3 is disregarded in calculation since it doesn't have data on Q4:

Using this logic you should be able to create the measure you want.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

Proud to be a Super User!

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors