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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
CSJ123
Frequent Visitor

Measure to show count of items after another column date

Hi

 

I wonder if someone can help me with this as I have been working on it for a while with limited success!!

 

I am trying to write a measure to show how many courses an instructor has taught since their last assessment. 

 

My columns are:

 

'Table1' [Last Instructor Check]

'Table2' [Total Courses] (a measured column combining 2 types of courses so not sure if table name needed)

 

The complication for me is that using this measure I need to create conditioning based on the [Instructor Risk Level] (contains values H, M, L) 

 

  • IF an instructor is Low Risk [Instructor Risk Level]= L, the column background should be green until that instructor has taught 6 courses since [Last Instructor Check], then change to red
  • IF an instructor is Medium Risk [Instructor Risk Level]= M, the column background should be green until that instructor has taught 3 courses since [Last Instructor Check], then change to red
  • IF an instructor is High Risk [Instructor Risk Level]= H, the column background should always be red.

 

 

Is this achievable in PowerBi?

 

Many thanks 🙂

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @CSJ123 ,

Please hvae a try.

Create a measure.

measure =
SWITCH (
    TRUE (),
    [Instructor Risk Level] = "L"
        && [Last Instructor Check] < 6, "Green",
    [Instructor Risk Level] = "L"
        && [Last Instructor Check] = 6, "Red",
    [Instructor Risk Level] = "M"
        && [Last Instructor Check] < 3, "Green",
    [Instructor Risk Level] = "M"
        && [Last Instructor Check] = 3, "Red",
    [Instructor Risk Level] = "H", "Red",
    BLANK ()
)

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

1 REPLY 1
Anonymous
Not applicable

Hi @CSJ123 ,

Please hvae a try.

Create a measure.

measure =
SWITCH (
    TRUE (),
    [Instructor Risk Level] = "L"
        && [Last Instructor Check] < 6, "Green",
    [Instructor Risk Level] = "L"
        && [Last Instructor Check] = 6, "Red",
    [Instructor Risk Level] = "M"
        && [Last Instructor Check] < 3, "Green",
    [Instructor Risk Level] = "M"
        && [Last Instructor Check] = 3, "Red",
    [Instructor Risk Level] = "H", "Red",
    BLANK ()
)

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.