cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
srivally Regular Visitor
Regular Visitor

get last month sales as Total sales

Hi All,

 

I have a scenario like, I want to display last month sales as Total sales for the year and Grand total should be sum of Total sales(last month sales) for all the years if I use matrix visualisation. But here if I use matrix visualisation, the total is getting sum of sales of all the months for that year. 

I can do it in tabular format by using rank function based on year and month and displaying only rank=1 as total which is not possible in matrix visualisation. 

I have attached the source and expected result in following path
https://www.dropbox.com/s/nqh42npw85qlo8d/data.xlsx?dl=0
https://www.dropbox.com/s/heoe1v7fbb7d3w6/Expected%20Result.png?dl=0

Please help me on this by suggesting with your ideas.

 

Regards,

Srivally

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
v-cherch-msft Super Contributor
Super Contributor

Re: get last month sales as Total sales

Hi @srivally

 

You may create a measure as below:

Measure  =
VAR a =
    CALCULATE ( MAX ( data[Month] ) )
RETURN
    IF (
        HASONEVALUE ( data[Month] ) = FALSE ()
            && HASONEVALUE ( data[Year] ),
        CALCULATE ( SUM ( data[Customer Balance] ), FILTER ( data, data[Month] = a ) ),
        CALCULATE ( SUM ( data[Customer Balance] ) )
    )

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Highlighted
v-cherch-msft Super Contributor
Super Contributor

Re: get last month sales as Total sales

Hi @srivally

 

You may create a measure as below:

Measure  =
VAR a =
    CALCULATE ( MAX ( data[Month] ) )
RETURN
    IF (
        HASONEVALUE ( data[Month] ) = FALSE ()
            && HASONEVALUE ( data[Year] ),
        CALCULATE ( SUM ( data[Customer Balance] ), FILTER ( data, data[Month] = a ) ),
        CALCULATE ( SUM ( data[Customer Balance] ) )
    )

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
srivally Regular Visitor
Regular Visitor

Re: get last month sales as Total sales

Hi @v-cherch-msft,

 

Thanks a lot for your reply, I got the exact solution what I need. Here i'm facing the other problem which is about Grand Total. Here the grand total is dispalying sum of all the sales, but I wanted to display only sum of subtotals. Also I do not have any option to hide the grand total. I have placed the exact requirement in the following path.

https://www.dropbox.com/s/avbe8mogmzxzwc5/Expected.png?dl=0
Could you please help me on this as well.

 

Regards,

Srivally

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 133 members 2,076 guests
Please welcome our newest community members: