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
Anonymous
Not applicable

MinMax values for non blank values of multiple columns

Hello Community,

 

I would appreciated it if you could help me with the below question.

 

I have the below table that has shows the benefits details per year of three projects.

 

What I want to create is a table that shows the minimum and maximum year per project, based on the non blank values of all three benefit columns.

 

Input table

 

ProjectYearBenefit1Benefit2Benefit3
Project12019 435311
Project12020133200141
Project12021281 380
Project12022   
Project22019 367 
Project22020298248262
Project22021255305348
Project22022203  
Project32019   
Project32020462467491
Project32021440 478
Project32022470  

      

Output table

 

ProjectMinYearMaxYear

Project1

20192021
Project220192022
Project320202022

 

Thank you in advance,

 

George

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try 2 measures like

 

Min year =

minx(filter(Table, not(isblank(Table[Benefit1])) || not(isblank(Table[Benefit2])) || not(isblank(Table[Benefit3]))), Table[Year])

 

max year =
maxx(filter(Table, not(isblank(Table[Benefit1])) || not(isblank(Table[Benefit2])) || not(isblank(Table[Benefit3]))), Table[Year])

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Try 2 measures like

 

Min year =

minx(filter(Table, not(isblank(Table[Benefit1])) || not(isblank(Table[Benefit2])) || not(isblank(Table[Benefit3]))), Table[Year])

 

max year =
maxx(filter(Table, not(isblank(Table[Benefit1])) || not(isblank(Table[Benefit2])) || not(isblank(Table[Benefit3]))), Table[Year])

Anonymous
Not applicable

Hello @amitchandak 

 

Your solution worked just fine. Thank you very much for that.

 

I tried to give you a Kudos and flag your reply as a solution, only to come across the below error.

 

"Authentication failed for the action you are trying to do. This failure could be due to your browser not supporting JavaScript, JavaScript not being enabled, or trying to use the action URL directly in the browser address bar instead of clicking the link on the page. "

 

Would you have any idea how this can be sorted out?

 

I also sent you a LinkedIn request, would be glad if you would accept it.

 

Kind regards,

 

George

@Anonymous , Accepted your LinkedIn connection. 

Just refresh and check if you still logged in. If not log in again and try. 

Anonymous
Not applicable

Hi @amitchandak ,

 

I just gave it another try to flag your input as solution without any success.

 

Can you please flag it as such?

 

Kind regards,

 

George

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.

Top Solution Authors