Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
AlexGallet01
Helper IV
Helper IV

I need help

Mesure 2015-2016 = CALCULATE(SUM(Factures[2015-2016]);FILTER(ALL(Factures);Factures[Mois.Date] >= DATE(2015;07;01) && Factures[Mois.Date] <= MAX(Factures[Mois.Date])))

 

Bonjour,

J'aimerais remplacer la fin de ma mesure (MAX(Facture[Mois.Date]) par une date précise mais sa ne fonctionne plus du tout lorsque je remplace cette fin par DATE(2016;06;31) et je ne comprend pas pourquoi.

 

Hello, I would like to replace the end of my measure (MAX (Invoice [Mois.Date]) with a specific date but it no longer works at all when I replace DATE (2016; 06; 31) and I do not understand why

20 REPLIES 20
AlexGallet01
Helper IV
Helper IV

I don't undertand how use your solution it is possible to use my measure and replace MAX(Facture[Mois.Date]) by DATE(2016;06;31) and have the same result ????

austinsense
Impactful Individual
Impactful Individual

Make your life a little easier and try this if you want a fixed set of dates (DATESBETWEEN) https://msdn.microsoft.com/en-us/library/ee634557.aspx

 

Bigger question, why do you want use fixed dates, that doesn't seem very useful for slicing and dicing?

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

Je souhaite faire un cumul de donées monétaire sur une année et ceci pour chaque années et ensuite pouvoir les comparere entre eux. Et lorsque je fais un datesbetween plus rien ne fonctionne

 

I wish to accumulate monetary data over a year and this for each year and then be able to compare them. And when I do a datesbetween nothing works anymore

D'accord.  You should make two formulas - You'll need to have a calendar table in your model.

 

Current Year (YTD)

 

Current Year (YTD) = CALCULATE([Revenue], DATESYTD(CalendarTable[Date]) )

 

 

Last Year (YTD)

 

CALCULATE([Current Year (YTD)],DATEADD(Calendar[Date],-1,YEAR) )

 

 

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

pour l'instant lorsque je les met en séparé tout fonctionne normalement mais des que je souhaite les réunir sour un même c'est le drame.

 

For the moment when I put them separated everything works normally but of the that I wish to join them to the same one it is the drama

 

Sans titre.png

Here's the trick - don't make a measure for every year.  Make one measure and then use a calendar table to slice the different years.

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

and i need the total for each month for each year

Je dois donc faire comme vous avez fait avant et en plus mes anées sont de juillet en juin de l'an d'après comment faire ?

 

So I have to do as you did before and in addition my years are from July to June of the following year how to do?

Just give it a try 🙂

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

Sans titre.png

Sans titre.png

Ok let me just slow this whole thing down - I would recommend getting a book and reading it. This is the best selling book on the topic (https://www.powerpivotpro.com/the-book/)

 

You're missing some of the fundamentals of how to put a data model together and that's messing up your formulas / making your formulas impossble.

 

If you wanna speak to someone who's awesome at this who also speaks french then I can make a recommendation - Tristan Malherbe is excellent.

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast 🙂

Or how to cumulate with this formula ?

 

Mesure = CALCULATE(SUM(Factures[2004-2005]);FILTER(Factures;Factures[Mois.Date] <= DATE(2005;06;31)))

hi @AlexGallet01

 

Try in this way:

 

1. A Calendar table with Fiscal Year, and Fiscal Month Number Columns

 

Fiscal Year =
IF ( MONTH ( 'Calendar'[Date] ) <= 6, 'Calendar'[Year], 'Calendar'[Year] + 1 )
Fiscal Month =
IF (
    MONTH ( 'Calendar'[Date] ) <= 6,
    'Calendar'[Month] + 6,
    'Calendar'[Month] - 6
)

2.  A new Measure

 

ValuesThisYear =
CALCULATE (
    SUM ( Table1[Value] ),
    DATESBETWEEN (
        'Calendar'[Date],
        CALCULATE (
            FIRSTDATE ( 'Calendar'[Date] ),
            FILTER (
                ALL ( 'Calendar' ),
                'Calendar'[Fiscal Year] = MIN ( 'Calendar'[Fiscal Year] )
            )
        ),
        LASTDATE ( 'Calendar'[Date] )
    )
)

3. Insert a slicer

 

Slicer.png

 

4. Insert a Visual Clustered Column Chart

Slicer2.png

 

5. If you need to sort the months  Select MonthN and Sort by Fiscal Month

 

FMSort.png




Lima - Peru

I use this formula

 

test = CALCULATE(SUM(Factures[MontantFacture]);DATESBETWEEN(Calendrier[Date].[Date];CALCULATE(FIRSTDATE(Calendrier[Date].[Date]);FILTER(ALL(Calendrier);Calendrier[AnnéeFiscal]=MIN(Calendrier[AnnéeFiscal])));
LASTDATE(Calendrier[Date].[Date])))

I try to use your solution but i don't have a cumulate result 

Hi 

 

I have a problem when i want create a column fiscal year i have an error ( Expressions that return a variant data type can not be used to define computed columns.)


@AlexGallet01 wrote:

Hi 

 

I have a problem when i want create a column fiscal year i have an error ( Expressions that return a variant data type can not be used to define computed columns.)


 

Did you try to create a calculated column like this?

Fiscal Year = IF ( MONTH ( 'Calendar'[Date] ) <= 6, 'Calendar'[Year], 'Calendar'[Year] + 1 )

 

Please check if the 'Calendar'[Year] data type is number rather than text. If issue persists, please share your .pbix file if possible.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

i do finish this for monday i don't have the time to read this book

pour l'instant lorsque je les met en séparé tout fonctionne normalement mais des que je souhaite les réunir sour un même c'est le drame.

 

For the moment when I put them separated everything works normally but of the that I wish to join them to the same one it is the drama

 

Sans titre.png

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.