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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
UsePowerBI
Post Prodigy
Post Prodigy

Conditional measure

Hello

 

I have a Measure like:

Measure=MAX([Value])

 

For the data:

Product,Value,Date

A, 1, Date1

B, 2, Date1

A, 3, Date1

 

I want for every date, when Product=A to return MAX([Value]) and when Product=B to return MAX(([Value])/100

 

However, when I try to create a Measure like this and use IF, it does not offer me to use a Column but only other Measures. Any idea?

 

Thanks!

1 ACCEPTED SOLUTION
themistoklis
Community Champion
Community Champion

@UsePowerBI 

 

Try the following formula. Also attached a workspace.

 

Column = If(Sheet1[Product] = "A",CALCULATE (
    MAX ( Sheet1[Value]),
    ALLEXCEPT ( Sheet1, Sheet1[Date] )
),
CALCULATE (
    MAX ( Sheet1[Value]),
    ALLEXCEPT ( Sheet1, Sheet1[Date] )
) /100
)

View solution in original post

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @UsePowerBI ,

 

Could you tell me if your problem has been solved by @themistoklis 's suggestion? If it is, kindly Accept it as the solution to make this thread closed. More people will benefit from it. Or you are still confused about it, please show me your expected output.

 

Best Regards,
Eyelyn Qin

themistoklis
Community Champion
Community Champion

@UsePowerBI 

 

Try the following formula. Also attached a workspace.

 

Column = If(Sheet1[Product] = "A",CALCULATE (
    MAX ( Sheet1[Value]),
    ALLEXCEPT ( Sheet1, Sheet1[Date] )
),
CALCULATE (
    MAX ( Sheet1[Value]),
    ALLEXCEPT ( Sheet1, Sheet1[Date] )
) /100
)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.