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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
v-tangjie-msft
Community Support
Community Support

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
v-tangjie-msft
Community Support
Community Support

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

Top Solution Authors