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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
vividarinda
Helper II
Helper II

How to get max min with condition another table

Hi All,

I have the data like this :

table historical ->

vividarinda_0-1717469636997.png

 

 

table logic ->

vividarinda_1-1717469636993.png

 

 

the current visualization  like this :

vividarinda_0-1717469923004.png

 

but expected result like this :

vividarinda_1-1717469923005.png

 

 

i want to show the visualization historical based on table logic.

this link for power bi : visualization 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @vividarinda ,

 

Thanks @RossEdwards  for the quick reply. I have some other thoughts to add:

1.We can create two measures.

_blowbypress_max =
CALCULATE (
    MAX ( 'raw data'[blowbypress_max] ),
    FILTER (
        ALLSELECTED ( 'raw data' ),
        'raw data'[unitno] = MAX ( 'raw data'[unitno] )
            && 'raw data'[blowbypress_max_flag] = 1
    )
)
_boost_press_max =
CALCULATE (
    MIN ( 'raw data'[boost_press_max] ),
    FILTER (
        ALLSELECTED ( 'raw data' ),
        'raw data'[unitno] = MAX ( 'raw data'[unitno] )
            && 'raw data'[boost_press_max_flag] = 1
    )
)

2.Then the result is as follows.

vtangjiemsft_0-1717569855875.png

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 @vividarinda ,

 

Thanks @RossEdwards  for the quick reply. I have some other thoughts to add:

1.We can create two measures.

_blowbypress_max =
CALCULATE (
    MAX ( 'raw data'[blowbypress_max] ),
    FILTER (
        ALLSELECTED ( 'raw data' ),
        'raw data'[unitno] = MAX ( 'raw data'[unitno] )
            && 'raw data'[blowbypress_max_flag] = 1
    )
)
_boost_press_max =
CALCULATE (
    MIN ( 'raw data'[boost_press_max] ),
    FILTER (
        ALLSELECTED ( 'raw data' ),
        'raw data'[unitno] = MAX ( 'raw data'[unitno] )
            && 'raw data'[boost_press_max_flag] = 1
    )
)

2.Then the result is as follows.

vtangjiemsft_0-1717569855875.png

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. 

RossEdwards
Solution Sage
Solution Sage

You can do this with a measure.  You'll need 1 measure for blowbypress_max and another for boost_press_max.

The basic structure of your measure would be:

Blow by Press Max = var UnitNo = SELECTEDVALUE('YourTable'[UnitNo])
RETURN
SWITCH(
	UnitNo,
	"PC2000", <Some Code Here>,
	"HD785", <Some Code Here>,
	"D375A", <Some Code Here>,	
	BLANK()
)

 

just replace the "Some Code Here" with the dax code that would do what you need and how it differs between units.

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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