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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
AlexGallet01
Helper IV
Helper IV

Schéma cumulé

Bonjour,

 

Je n'arrive pas a effectué un schéma de données monétaires qui se fait de mois en mois car j'aimerais fixer des limites de date mais sa ne fonctionne pas. Lorsque je fais un DATESBETWEEN de ma colonne il me renvois comme message d'erreurs que je passe une table de valeurs. 

 

I can not make a schema of monetary data that is done from month to month because I would like to set date limits but it does not work. When I do a DATESBETWEEN of my column it returns me as error message that I pass a table of values.

 

code : 

Mesure=CALCULATE(SUM(Factures[PFCNMT]);FILTER(ALL(Factures);DATESBETWEEN(Factures[Mois.Date];DATE(2016;07;01);DATE(2017;06;31))))

 

 

1 ACCEPTED SOLUTION
LaurentCouartou
Solution Supplier
Solution Supplier

The second argument to the FILTER function must be a scalar expression (boolean). The DATESBETWEEN function will typically return several dates.

 

In your case, the FILTER is probably not required, so the following might be what you are looking for:

 

Mesure=CALCULATE(SUM(Factures[PFCNMT])
; DATESBETWEEN( Factures[Mois.Date]; DATE(2016;07;01); DATE(2017;06;31) )
)

In case you decide to add a Dates table to your model (which is recommended) and after you created a relationship between Factures and Dates, you will be able to write the following.

 

Mesure=CALCULATE(SUM(Factures[PFCNMT])
; DATESBETWEEN( Dates[Date]; DATE(2016;07;01); DATE(2017;06;31) )
)

 

View solution in original post

8 REPLIES 8
LaurentCouartou
Solution Supplier
Solution Supplier

The second argument to the FILTER function must be a scalar expression (boolean). The DATESBETWEEN function will typically return several dates.

 

In your case, the FILTER is probably not required, so the following might be what you are looking for:

 

Mesure=CALCULATE(SUM(Factures[PFCNMT])
; DATESBETWEEN( Factures[Mois.Date]; DATE(2016;07;01); DATE(2017;06;31) )
)

In case you decide to add a Dates table to your model (which is recommended) and after you created a relationship between Factures and Dates, you will be able to write the following.

 

Mesure=CALCULATE(SUM(Factures[PFCNMT])
; DATESBETWEEN( Dates[Date]; DATE(2016;07;01); DATE(2017;06;31) )
)

 

La première solution que vous me proposait ne fait pas se que je veut. Je veut que pour le mois d'aout 2016 sa fasse juillet2016 + aout 2016 et ainsi de suite.

 

The first solution you proposed to me does not do what I want. I want for the month of august 2016 to be July 2016 + august 2016 and so on.

AlexGallet01
Helper IV
Helper IV

Bonjour,

 

J'ai un problème je ne arrive pas à faire un schéma avec des données Monétaires Qui se cumul de mois en mois et Qui Possède une date de fin précise. Quand je passe en paramètre une date de fin rien ne va plus.

 

Le code marche quand je ne mais pas de date de fin mais sa me fait le cumul sur toute les Annees Alors Que je aimerais Avoir un schéma pour chaque année.

 

code qui fonctionne: Mesure = CALCULATE (SUM (Factures [PFCNMT]); FILTER (ALL (Factures); Factures [Mois.Date] <= MAX (Factures [Mois.Date])))

 

code qui ne fonctionne pas : Mesure 3 = CALCULATE(SUM(Factures[PFCNMT]);FILTER(All(Factures);Factures[Mois.Date] <= DATE(2005;06;31)))

 

 

Is it possible to post in English , my dear friend 

Hello,
 
I have a problem I can not make a schema with Monetary data That accumulates from month to month and that has a specific end date. When I pass in parameter an end date nothing goes more.
 
The code works when I do not have an end date but it makes me accumulate on all the years so I would like to have a schema for each year.

Je n'y arriverais pas je suis nul en anglais.

 

 

Hello,
 
I have a problem I can not make a schema with Monetary data That accumulates from month to month and that has a specific end date. When I pass in parameter an end date nothing goes more.
 
The code works when I do not have an end date but it makes me accumulate on all the years so I would like to have a schema for each year.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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