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

Help needed with month total

Hi all, thanks for all previous help. Love this community. 

 

I've got a bit of an interesting one i'm hoping you guys can help me with. 

I've got a calculated colum displaying total month income per customer and because of the datastructure i've been forced into having it like that - I know it is not ideal... 

I'm now trying to make a calculated column for a month total based on the sales per month column. 

Below is a mock sheet with some data and what would be the desired outcome. the desired outcome is a sum by month of the uniqe value per customer. 

   desired outcome
dateCustomer Sales per monthTotal sales month
03.01.2022xx150000450000
02.01.2022xx150000450000
01.01.2022xx150000450000
03.01.2022yy200000450000
02.01.2022yy200000450000
01.01.2022yy200000450000
03.01.2022zz100000450000
02.01.2022zz100000450000
03.02.2022xx50000180000
02.02.2022xx50000180000
01.02.2022xx50000180000
03.02.2022yy100000180000
02.02.2022yy100000180000
01.02.2022yy100000180000
03.02.2022zz30000180000
02.02.2022zz30000180000


in advance thanks for any help! 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a calculated column.

Jihwan_Kim_0-1665649690705.png

 

Total sales month CC =
VAR _currentmonthend =
    EOMONTH ( Data[date], 0 )
VAR _uniquetablepermonth =
    SUMMARIZE (
        FILTER ( Data, EOMONTH ( Data[date], 0 ) = _currentmonthend ),
        Data[Customer],
        Data[Sales per month]
    )
RETURN
    SUMX ( _uniquetablepermonth, Data[Sales per month] )

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
siros92
Frequent Visitor

Thank you very much, you my friend are a propper star! 

Again thank you as well for also taking the time to show it propperly it is greatly appreciated. 

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a calculated column.

Jihwan_Kim_0-1665649690705.png

 

Total sales month CC =
VAR _currentmonthend =
    EOMONTH ( Data[date], 0 )
VAR _uniquetablepermonth =
    SUMMARIZE (
        FILTER ( Data, EOMONTH ( Data[date], 0 ) = _currentmonthend ),
        Data[Customer],
        Data[Sales per month]
    )
RETURN
    SUMX ( _uniquetablepermonth, Data[Sales per month] )

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.