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

Cumulative total per year from 1rst January until 6th February

Hi


Let's assume that we are on 06/02/2018 and we have the sales from 01/01/2017 until 06/02/2018.
I would like to compare on a matrix the turnover done each year from 01/01 until 06/02.
It has to be a matrix to drill down per store.

By default, on February 2017, it includes sales from 01/02/2017 until 28/01/2017.

cumulative total.PNG

 

 

I tried to create a calendar table where I added SAMEPERIODLASTYEAR but it doesnt work.
Any solution please ?

here is the pbi.file

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Ashish_Mathur

I ve been inspired by your solution.

 

The aim was to use a slicer with a range.

Therefore, I used a very very very primitve solution (i.e ugly and uncomfy for final user but effective).

Please find here the file

 

The cons: It's not dynamic. The user has to figure out about the date limit to get the YTD and to conceptualize it (1rst February => 0201)

 

I created a column which concatenate Month & Day on Query Editor.

 

= Table.AddColumn(#"Source", "MMDD", each Date.ToText([Date], "MM")& Date.ToText([Date], "dd"))

 

Capture.PNG

View solution in original post

6 REPLIES 6
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

Have you solved the problem?

 

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please feel free to ask.

 

Best Regards

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

 

Sales from Feb 1 to Feb 6 2017 is 167.1.  You may download my PBI file from here.  I have also solved a similar problem here - Show sales only for corresponding months in prior years.

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur

I ve been inspired by your solution.

 

The aim was to use a slicer with a range.

Therefore, I used a very very very primitve solution (i.e ugly and uncomfy for final user but effective).

Please find here the file

 

The cons: It's not dynamic. The user has to figure out about the date limit to get the YTD and to conceptualize it (1rst February => 0201)

 

I created a column which concatenate Month & Day on Query Editor.

 

= Table.AddColumn(#"Source", "MMDD", each Date.ToText([Date], "MM")& Date.ToText([Date], "dd"))

 

Capture.PNG

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

What about the measure below?

 

Measure =
VAR year =
    MAX ( 'Calendar'[Year] )
RETURN
    CALCULATE (
        SUM ( 'Sales'[Turnover] ),
        DATESBETWEEN ( 'Calendar'[Date], DATE ( year, 1, 1 ), DATE ( year, 2, 6 ) ),
        FILTER ( 'Calendar', YEAR ( 'Calendar'[Date] ) = year )
    )

Here is the output.

 

Capture.PNG

 

If you still need help, please share your desired output so that we could help further on it.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Unfortunately, your solution forces the user to verify the DAX formula and to refresh it at each update 😞

Greg_Deckler
Super User
Super User

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.