Skip to main content
cancel
Showing results for 
Search instead 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

Reply
ecoquelet
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.

 

Capture d’écran 2022-10-31 181551.png

 

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).

 

chart.png

 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 ?

 

Thank you in aadvance !

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

Here is one approach to this:

Data:

ValtteriN_0-1667380408574.png

 

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:

ValtteriN_1-1667380486844.png

 

When selecting Q4 P3 is disregarded in calculation since it doesn't have data on Q4:
ValtteriN_2-1667380525459.png

 

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!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ValtteriN
Super User
Super User

Hi,

Here is one approach to this:

Data:

ValtteriN_0-1667380408574.png

 

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:

ValtteriN_1-1667380486844.png

 

When selecting Q4 P3 is disregarded in calculation since it doesn't have data on Q4:
ValtteriN_2-1667380525459.png

 

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!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Community Conference

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.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

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