cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
diogonesbitt
Frequent Visitor

help with partial total to cohort

Hi everyone, after one day trying all suggestions on this forum I will ask for help because I cant find the solution for something that seems simple.

 

To create a cohort matrix I need a column with the total of the month

the table shouldlook like these

cohort help

 

Thanks for help.

 

1 ACCEPTED SOLUTION

Hi diogonesbitt,

I have already added the year column as a filter in the formula, so it will only calculate the value within the same year range, and if you woud like to sum the value in month range, create a column which format with year and month with the date column, then use that column as a filter.

GroupTotal = sumx(

                   filter(

                      'Table',

                       And('Table'[Mes]=earlier('Table'[mes]),

                                 ‘Table’[Ano]=Earlier(‘Table’[Ano]))

                           ),

                   'Table'[Count of id])

Regards

View solution in original post

8 REPLIES 8
Greg_Deckler
Super User
Super User

I don't see your image. Sample data would be great too.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler Thanks for quick reply.

 

the image again.

cohort data

Hi diogonesbitt,

 

We could create a calculated column to calculate the group total, with the formula below:

GroupTotal = sumx(

                   filter(

                      'Table',

                       And('Table'[Mes]=earlier('Table'[mes]),

                                 ‘Table’[Ano]=Earlier(‘Table’[Ano]))),

                   'Table'[Count of id])

Check to see if this would meet your requirements.

Regards

Hi Michael, Thanks for reply,

 

The problem is that in thant case May 2015 will sum with may 2014. I'm I wrong?

Hi diogonesbitt,

I have already added the year column as a filter in the formula, so it will only calculate the value within the same year range, and if you woud like to sum the value in month range, create a column which format with year and month with the date column, then use that column as a filter.

GroupTotal = sumx(

                   filter(

                      'Table',

                       And('Table'[Mes]=earlier('Table'[mes]),

                                 ‘Table’[Ano]=Earlier(‘Table’[Ano]))

                           ),

                   'Table'[Count of id])

Regards

Thanks Michael it works.

 

But I still have 1 question,

 

I cant user the 'Table'[Date].MonthNum instead new column called 'Table'.[Month]. Why?

 

 

Hi,

 

What " 'Table'[Date].MonthNum " indicates here, and how it works?

 

Could you please share the formula reference here?

Regards

diogonesbitt
Frequent Visitor

Hi everyone, after one day trying all suggestions on this forum I will ask for help because I cant find the solution for something that seems simple.

 

To create a cohort matrix I need a column with the total of the month

the table shouldlook like these

cohort help

 

Thanks for help.

 

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors