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
celantjm
Regular Visitor

cumulative between last month of a previous year and first month of this year

 

Hi all,

 

I have a probleem with the cumulative result between two year.

 

I want follow the evolution of the stock. In tabel 1, I follow the balance between the in et the out month per month.  I use this formule :

Balance In & Out = CALCULATE(COUNT('Stock incident'[number]); 'Stock incident'[Mouvement] = "IN")-CALCULATE(COUNT('Stock incident'[number]); 'Stock incident'[Mouvement] = "OUT")
 
The result is good ("number" is the number of the incident).

 

cumulative.png

 

 

But I want to know the stock in the end of every month (tabel 2). The result is good in 2018. But, when arrive january 2019, the "forgot" the last month of 2018 and the result. I would like that the result of january 2019 is "1684+2469".

The formule that I use is :

Evolution du nombre d'incidents encore ouverts =
CALCULATE(
    [Balance In & Out];
    FILTER(
        CALCULATETABLE(
            SUMMARIZE(
                'Stock incident';
                'Stock incident'[Date].[NoMois];
                'Stock incident'[Date].[Mois]
            );
            ALLSELECTED('Stock incident')
        );
        ISONORAFTER(
            'Stock incident'[Date].[NoMois]; MAX('Stock incident'[Date].[NoMois]); DESC;
            'Stock incident'[Date].[Mois]; MAX('Stock incident'[Date].[Mois]); DESC
        )
    )
)
 
Anyone have a solution ?
 
Thank you

 

3 REPLIES 3
Anonymous
Not applicable

Hi.

 

First of all, you should NEVER, EVER, EVER use the automatically generated date table in the model. I know you do because you use this 'Stock incident'[Date].[NoMois], which is a sign of bad design. Please, do yourself and others a favour and create a proper Date Table in the model together with relationships. You can read about date tables and time intelligence in tabular models on www.sqlbi.com (and about many more things). Once you do have the right setup, please post something that is more readable. I can't help you even if I wanted because I don't understand what you want. I appreciate English is probably not your first language and you're probably using Google Translator but if you don't phrase your question correctly, you won't get a correct answer. Easy as that.

 

Best

Darek

Man, you link sucks !

I'm not here to have insult. Insult which is followed with a commercial site ! 

I'm here to have solution. You have a dax-code for my problem, you give. No ? you leave. 

 

About language, you use one or two approximate word to critic. You have undestand because you can say that my code isn't goed. I know, it's the reason that i'm here. When one of you compatriote will speak in my language with mistake word, i'll say that i don't understand and that I'll not help him. 

 

 

 

Anonymous
Not applicable

LoL 🙂

 

How do you want others to help you if they can't understand the problem? Think clearly, mate, and try to hold your emotions at bay. The "commercial" site - LoL 🙂 - is the best site on DAX you can find as it's led by the two most famous people in the DAX world (but I understand you might not know this).

 

You seem not to understand my intentions. So be it.

 

Be well and wait for a solution.

 

Best

Darek

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.