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
Salesforce
Frequent Visitor

Multiple Column having filter

Hello Team,

Can anyone help me with the scenario or example related? I'm new to power bi and learning.

We had a requirement to create filter data for multiple columns.

The Scenario is companies get their contracts renewed every 3 years. If they don't want to renew then it will be considered discontinued. Any help very much appreciated.

Columns as --Company Name,Date of issue,Status(Active,Expired,Discontinue),Category(New,End Of cycle-3years) ,ID'setc.

The issue is when the company has completed its contract for 3 years -and renewed.. they were generated with new IDs and categories as New.

For Example - Company A, Company B, Company C

Company NameStatusDate of IssueIDCategory
Company AExpired07/15/2019IDAEnd of Cycle 
Company BActive08/08/2020IDBNew
Company CDiscontinued08/06/2018IDCEnd of Cycle
     

 

Table 2 :

Company NameStatusDate of IssueIDCategory 
Company AActive07/16/2022IDA1New 
Company BActive08/08/2020 IDBNew 
Company CDiscontinued08/06/2018IDCEnd of Cycle 

 

Company D

Active08/08/2022IDDNew 

Company A was created on the year 07/15/2019 -completed the 3 years cycle on 7/14/2022 -Their ID was given as ID A.Status is Expired.

Now Company A went for renewal in the year 2022. Their ID was generated New as !D A1.Status as Active and Category as New.

Similarly, other companies got discontinued in between, etc. New companies took new contracts.

How do I filter to know which company has completed 3 years of cycle and went for renewal? Which are new clients for this year etc.

Any help is Very much appreciated.Thank you in advance.

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @Salesforce ,

 

Please try:

Create two measures:

New = 
var _a = CALCULATE(COUNT('Table'[Company Name]),FILTER('Table',[Company Name]=MAX('Table 2'[Company Name])))
return IF(MAX('Table 2'[Status])="Active"&&_a=BLANK(),1,0)

Renew = 
var _a = CALCULATE(MAX('Table'[Status]),FILTER('Table',[Company Name]=MAX('Table 2'[Company Name])))
return IF(MAX('Table 2'[Status])="Active"&&_a="Expired",1,0)

Then create two table visuals(using 'Table 2'[Company Name]) and apply these measures to the visuals(one by one):

vjianbolimsft_0-1663726860330.png

vjianbolimsft_1-1663726875304.png

Then turn on the title of these visuals:

vjianbolimsft_2-1663726936552.png

vjianbolimsft_3-1663726950072.png

Final output:

vjianbolimsft_4-1663726966684.png

 

 

 

 

Best Regards,

Jianbo Li

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

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @Salesforce ,

 

Please try:

Create two measures:

New = 
var _a = CALCULATE(COUNT('Table'[Company Name]),FILTER('Table',[Company Name]=MAX('Table 2'[Company Name])))
return IF(MAX('Table 2'[Status])="Active"&&_a=BLANK(),1,0)

Renew = 
var _a = CALCULATE(MAX('Table'[Status]),FILTER('Table',[Company Name]=MAX('Table 2'[Company Name])))
return IF(MAX('Table 2'[Status])="Active"&&_a="Expired",1,0)

Then create two table visuals(using 'Table 2'[Company Name]) and apply these measures to the visuals(one by one):

vjianbolimsft_0-1663726860330.png

vjianbolimsft_1-1663726875304.png

Then turn on the title of these visuals:

vjianbolimsft_2-1663726936552.png

vjianbolimsft_3-1663726950072.png

Final output:

vjianbolimsft_4-1663726966684.png

 

 

 

 

Best Regards,

Jianbo Li

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

 

 

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.