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
tinkertrust
Frequent Visitor

Flag customers that exceed limits (and Sum by month using calculation)

I'm sorry this is such a simple question, but I can't figure it out from googling. Can someone help me with following?

 

I have a table with daily actions against a table with contract maximums per month. I'm trying to create a table that lists customers that have exceeded their allowable question limit per month. In summary:

 

Where I have:

Questions submitted (daily) in Daily_Feed

Allowable questions per month in Client_Lookup

Calendar_Lookup table

 

I need to do something like:

1. Sum daily questions per client per month.

2. Flag where the sum of questions per month exceeds the allowable questions per month in the Client_Lookup.

 

 I can obviously do step 1 visually using a table, but that won't allow me to do step 2.

 

Your help would be hugely appreciated!!

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @tinkertrust,

 

Please refer to below measures:

daily questions per client per month =
CALCULATE (
    COUNT ( Daily_Feed[Question] ),
    ALLEXCEPT ( Daily_Feed, Daily_Feed[Client], Daily_Feed[Date].[MonthNo] )
)

allowable questions per month =
CALCULATE (
    SUM ( Client_Lookup[Allowable questions] ),
    FILTER (
        Client_Lookup,
        Client_Lookup[Client] = SELECTEDVALUE ( Daily_Feed[Client] )
            && Client_Lookup[MonthNo] = SELECTEDVALUE ( Daily_Feed[Date].[MonthNo] )
    )
)


flag =
IF (
    Daily_Feed[daily questions per client per month]
        > [allowable questions per month],
    "exceed",
    BLANK ()
)

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @tinkertrust,

 

Please refer to below measures:

daily questions per client per month =
CALCULATE (
    COUNT ( Daily_Feed[Question] ),
    ALLEXCEPT ( Daily_Feed, Daily_Feed[Client], Daily_Feed[Date].[MonthNo] )
)

allowable questions per month =
CALCULATE (
    SUM ( Client_Lookup[Allowable questions] ),
    FILTER (
        Client_Lookup,
        Client_Lookup[Client] = SELECTEDVALUE ( Daily_Feed[Client] )
            && Client_Lookup[MonthNo] = SELECTEDVALUE ( Daily_Feed[Date].[MonthNo] )
    )
)


flag =
IF (
    Daily_Feed[daily questions per client per month]
        > [allowable questions per month],
    "exceed",
    BLANK ()
)

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Seward12533
Solution Sage
Solution Sage

Trick is you need to use an aggregate measure for the target even if it’s a single value.

NumQAksed = COUNTROWS(daily_feed)
CountLimit =SUM(client_limit[limit])
Flag=[NumQAsked]>[CountLimit]

Then use these measures in your table/matrix or other visual.

If you want to get fancy this will display an actual flag.

DisplayFlag = IF([Flag],UNICHAR(128681))

If you want show a flag if an aggregate measure exceeds limit when summarized at a higher level even if aggregate value looks ok. Search for bubble measure

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.