Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
samoberoi
Helper III
Helper III

Min Values in a column to be switched to IN statement

Hi, 

I have a table which has minimum and maximum timing of each student already drawn in the Min and Max columns in the data file given.  I wanted to switch each Minimum timing in the Min column to the value "Entry" and each Max timing from the Max column to the word "Exit". I am trying to do that through IF or SWITCH statement but it needs an expression for Min and Max, which i am unable to create because the timing column is not there wherefrom i would have manually drawn Min and Max as a measure and the Minimum and Maximum timings are already given in the data table.

 

Can someone please help me in knowing how i can change these Min and Max timings to ENTRY and EXIT values?

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @samoberoi ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.

vtangjiemsft_0-1699325561386.png

(2) We can create measures.

min Measure = IF(MAX('Table'[min])=MINX(ALLSELECTED('Table'),[min]),"Entry",MAX('Table'[min]))
max Measure = IF(MAX('Table'[max])=MAXX(ALLSELECTED('Table'),[max]),"Exit",MAX('Table'[max]))

 (3) Then the result is as follows.

vtangjiemsft_1-1699325657801.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

2 REPLIES 2
Anonymous
Not applicable

Hi @samoberoi ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.

vtangjiemsft_0-1699325561386.png

(2) We can create measures.

min Measure = IF(MAX('Table'[min])=MINX(ALLSELECTED('Table'),[min]),"Entry",MAX('Table'[min]))
max Measure = IF(MAX('Table'[max])=MAXX(ALLSELECTED('Table'),[max]),"Exit",MAX('Table'[max]))

 (3) Then the result is as follows.

vtangjiemsft_1-1699325657801.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Ritaf1983
Super User
Super User

Hi @samoberoi 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.