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
Anonymous
Not applicable

Create graph of sum of customers per year

Hi

 

I am new to power BI and are trying to create a graph that shows the sum of total customers per year.

 

Now I have created a measure that counts all customers and have a chart that display the increase per year:

chart.png

I want it to be the sum. so line 1, line 2(1+2), line 3(1+2+3), line 4(1+2+3+4) and so on. 

 

How can I create this

 

Thanks for the help

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

You can calculate cumulative count of customer using Measure as well:

 

Running Total MEASURE = 
CALCULATE (
    Count ( 'Table'[CustomerColumn] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Date] <= MAX ( 'Table'[Date] )
    )
)

 

 Please give Kudos to this effort and also accept this as a solution so other can take help from it! 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

5 REPLIES 5
Tahreem24
Super User
Super User

HI @Anonymous,

 

As per my understanding you want Cumulative count of the customer.

Running Total COLUMN =
CALCULATE (
    Count ( 'Table'[CustomerColumn] ),
    ALL ( 'Table' ),
    'Table'[Date] <= EARLIER ( 'Table'[Date] )
)

 

Please give Kudos to this effort and also accept this as a solution so other can take help from it! 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Hi @Anonymous ,

 

You can calculate cumulative count of customer using Measure as well:

 

Running Total MEASURE = 
CALCULATE (
    Count ( 'Table'[CustomerColumn] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Date] <= MAX ( 'Table'[Date] )
    )
)

 

 Please give Kudos to this effort and also accept this as a solution so other can take help from it! 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

Hi @Tahreem24 

 

Thanks for the help!

 

Is there a way to add more filters to the query? I need it to be onlye active cusomers (status = 1)

 

I cannot get it to work

 

Thanks 

Hi @Anonymous ,

Yes you can use AND function in filter like below:

Spoiler
Running Total MEASURE = 
CALCULATE (
    Count ( 'Table'[CustomerColumn] ),
    FILTER (
        (ALL ( 'Table' ),
        'Table'[Date] <= MAX ( 'Table'[Date] )) && Status=1)
    )
)


OR Use the 2 different Filter function like below:

CALCULATE ( SUM ( Table[amount] ), FILTER ( Table, Table[Column1] = ??? ), FILTER ( Table, Table[Column2] = ??? ) )

Please give Kudos to this effort!

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

Hi thanks for your reply

 

The last one wont work as a count guids that are strings.

 

In the first example I have this query:

Running Total Coumn = CALCULATE(COUNT(Contact[contactid]);FILTER(ALL(Contact);Contact[mg_customerstartdate] <= MAX (Contact[mg_customerstartdate])) && Contact[statuscode_display]="Aktiv")

 

I get this error message: 

A function 'FILTER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

 

Do you know what is wrong?

Thanks

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.