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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
bmk
Helper II
Helper II

Generate text based on condition like in Excel

Consider an Excel blank sheet where cell A1 = 12, and we define a condition for cell B1 =IF(A1>10,"Cell is greater than 10", "Cell is less than 10"). Result for cell B1 = Cell is greater than 10.

 

How do I achieve this on Power BI, in a simple table format just like in Excel, preferably multiple lines with conditions and results like the above.

1 ACCEPTED SOLUTION

3 REPLIES 3
Anonymous
Not applicable

Hi @bmk ,

I created a sample pbix file(see attachment), please check whether that is what you want.

Create a measure or calculated column as below to get the status text:

Measure = 
VAR _curvalue =
    SELECTEDVALUE ( 'Table'[A] )
RETURN
    IF (
        _curvalue > 10,
        "Cell is greater than 10",
        IF ( _curvalue < 10, "Cell is less than 10", "Cell is equal to 10" )
    )
Column = 
SWITCH (
    TRUE (),
    'Table'[A] > 10, "Cell is greater than 10",
    'Table'[A] < 10, "Cell is less than 10",
    "Cell is equal to 10"
)

yingyinr_0-1633574635385.png

Best Regards

Thank you!

smpa01
Super User
Super User

@bmk  with DAX measuere

 

Measure = switch (true(), calculate(max(fact[colA]))>10, "Cell is greater than 10","Cell is lesser than 10")
           
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.