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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Sjmiller
Regular Visitor

Convert period to consistent time frame

I have some data that I am not sure how to convert. It looks like this:

name# AllowedPeriodUsed
Jones3Week2
Smith5Month1
Weston1Quarter5
Marley8Month3
King4Week4
Johnson9Quarter8


I need to be able conditionally format the Used column when they are under their allowed #. So for a given date such as 4/1/23-4/28/2023 if Jones used 2 total, but was allowed 3 a week he would be drastically under his allowed and would go red or whatever.  I need to figure out how to I think first put all these in the same type of time frame.  But the date slicer can be anything, maybe I should lock this somehow? but still unsure the best route to convert all to the same time frame. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Sjmiller,

I'd like to suggest you write a measure formula to compare with allowed and used amount based on current user and period group and return different color code to use in conditional formatting.

Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

formula=
VAR allowed =
    CALCULATE (
        SUM ( Table1[# Allowed] ),
        ALLSELECTED ( Table1 ),
        VALUES ( Table1[name] ),
        VALUES ( Table1[Period] )
    )
VAR used =
    CALCULATE (
        SUM ( Table1[Used] ),
        ALLSELECTED ( Table1 ),
        VALUES ( Table1[name] ),
        VALUES ( Table1[Period] )
    )
RETURN
    IF ( allowed > used, "Green", IF ( allowed = used, "Yellow", "Red" ) )

Regards,
Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

HI @Sjmiller,

I'd like to suggest you write a measure formula to compare with allowed and used amount based on current user and period group and return different color code to use in conditional formatting.

Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

formula=
VAR allowed =
    CALCULATE (
        SUM ( Table1[# Allowed] ),
        ALLSELECTED ( Table1 ),
        VALUES ( Table1[name] ),
        VALUES ( Table1[Period] )
    )
VAR used =
    CALCULATE (
        SUM ( Table1[Used] ),
        ALLSELECTED ( Table1 ),
        VALUES ( Table1[name] ),
        VALUES ( Table1[Period] )
    )
RETURN
    IF ( allowed > used, "Green", IF ( allowed = used, "Yellow", "Red" ) )

Regards,
Xiaoxin Sheng

Helpful resources

Announcements
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.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.