Forum Discussion

SirBI's avatar
SirBI
Frequent Visitor
3 years ago
Solved

Dynamic Sum of Column

Hello all. I have the below table (Daily Request) loaded into PBI: 

 

DateSumSuccess**SuccessFalseCount
12/22/22100True15
12/22/225False15
12/21/22200True15
12/21/2210False15

 

I created a measure (see above that give me a total count)

    

FailedRequest =
CALCULATE (
SUM( 'Daily Requests'[totalCount] ),
FILTER (
ALL('Daily Requests'),
'Daily Requests'[mmddyy]
&& 'Daily Requests'[success] = "False"))
 
I want the count to reflect for each day. 
 How can I create a dynamic count per day?
 
For example:
DateSumSuccess**SuccessFalseCount
12/22/22100True5
12/22/225False5
12/21/22200True10
12/21/2210False10
 
  • Hi, SirBI,

    Total count of false pr day =
    VAR _date =
        SELECTEDVALUE ( DailyRequest[Date] )
    VAR _tmp =
        CALCULATETABLE (
            FILTER (
                ALL ( DailyRequest ),
                DailyRequest[Date] = _date
                    && DailyRequest[Success] = FALSE ()
            )
        )
    RETURN
        SUMX ( _tmp, DailyRequest[Total count column] )
    

     

     

     Cheers,
    Sturla

    If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

1 Reply

  • sturlaws's avatar
    sturlaws
    Icon for Resident Rockstar rankResident Rockstar

    Hi, SirBI,

    Total count of false pr day =
    VAR _date =
        SELECTEDVALUE ( DailyRequest[Date] )
    VAR _tmp =
        CALCULATETABLE (
            FILTER (
                ALL ( DailyRequest ),
                DailyRequest[Date] = _date
                    && DailyRequest[Success] = FALSE ()
            )
        )
    RETURN
        SUMX ( _tmp, DailyRequest[Total count column] )
    

     

     

     Cheers,
    Sturla

    If this post helps, then please consider Accepting it as the solution. Kudos are nice too.