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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kris1989
Regular Visitor

If statement or something that will help!

Hi in need of some assistance.

 

I need a code (first thing that comes to mind is an if statement) for the following:

IF total expenditure = $5000000 and below "low risk", IF total expenditure = $5000001 - $10000000, "Medium Risk", IF total expenditure = $10000001+, "High Risk"

 

The Power Bi visualisation being used is a card and I need it linked to another card that displays the total expenditure in a report.

 

Thanks!!

1 ACCEPTED SOLUTION

@kris1989

 

Just need to use a card with states--this is a custom visual.

 

You can download from here.

 

https://app.powerbi.com/visuals/

 

I attach a sample of your case:

 

Sample




Lima - Peru

View solution in original post

3 REPLIES 3
Vvelarde
Community Champion
Community Champion

@kris1989

 

Hi, Create a Measure

 

 

Risk_State =
IF (
    SUM ( 'TableName'[Expenditure] ) < 5000000,
    "low risk",
    IF (
        SUM ( 'TableName'[Expenditure] ) < 10000000,
        "Medium Risk",
        "High Risk"
    )
)



Lima - Peru

@Vvelarde

 

G'day mate,

 

That worked but I gave you the wrong instructions my apologies. Here is how i'd like my report to work:

- I have two page slicers, one for the financial year change and the other for "On Contract Spend" and "Off Contract Spend".

- I have the following cards:

Card 1 Total Spend (column is expenditure)

Card 2 Spend Off Contract (column is expenditure with an additional filter of Off and On Contract column)

Card 3 Risk Rating Low $5mil and below, Med $10mil to $5mil and High $10mil+. I would like this to be linked somehow just to card 2 if possible.

 

Would even be cooler if I could change colours ie low risk is green, med risk is orange and high is red.

 

Thanks for your help!!

@kris1989

 

Just need to use a card with states--this is a custom visual.

 

You can download from here.

 

https://app.powerbi.com/visuals/

 

I attach a sample of your case:

 

Sample




Lima - Peru

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.