Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Bonjour Ă tous,
J’ai un problème avec une mesure DAX que j’essaie de créer dans Power Pivot pour calculer une facturation trimestrielle à partir d’une table F_Tableau_Mandat.
🎯 Objectif : Je veux calculer la somme des 3 mois d’un trimestre et l’afficher dans mon Tableau Croisé Dynamique (TCD).
📌 Exemple attendu :
Si je sélectionne Février, il doit afficher la somme d'une mesure précédemment définie appliquée à Janvier + Février + Mars. Si je sélectionne Mai, il doit afficher Avril + Mai + Juin. Etc. 📌 Contrainte :
Mon modèle doit conserver les autres filtres actifs, notamment sur les colonnes # Compte, Participation, et Statut.
Mon problème actuel est que le filtre sur # Compte saute et affiche une somme globale. 📌 Données Ma table F_Tableau_Mandat contient :
Mois # Compte Participation Statut Mand_Débit_Suivi_HT 2024-01-01 706000 PartA Actif 1000 2024-02-01 706000 PartA Actif 1200 2024-03-01 706000 PartA Actif 1100 2024-04-01 706000 PartB Actif 1300 2024-05-01 706000 PartB Actif 1400
📌 Ce que je veux obtenir dans mon TCD : Si je sélectionne Février, la mesure doit retourner 1000 + 1200 + 1100 = 3300. Si je sélectionne Mai, elle doit retourner 1300 + 1400 + Juin.
🔍 Mon code DAX actuel DAX Copier Modifier Mand_Facturation_Trimestrielle = VAR CurrentMonth = MONTH( MAX(F_Tableau_Mandat[Mois]) ) VAR CurrentYear = YEAR( MAX(F_Tableau_Mandat[Mois]) )
VAR DebutTrimestre = SWITCH( TRUE(); CurrentMonth = 2 ; DATE(CurrentYear; 1; 1); CurrentMonth = 5 ; DATE(CurrentYear; 4; 1); CurrentMonth = 8 ; DATE(CurrentYear; 7; 1); CurrentMonth = 11 ; DATE(CurrentYear; 10; 1); BLANK() )
VAR FinTrimestre = EOMONTH(DebutTrimestre; 2) -- Fin du trimestre
RETURN CALCULATE( SUMX( FILTER( ALL(F_Tableau_Mandat[Mois]); -- Supprime uniquement le filtre sur Mois F_Tableau_Mandat[Mois] >= DebutTrimestre && F_Tableau_Mandat[Mois] <= FinTrimestre ); [Mand_Débit_Suivi_HT] ); ALLEXCEPT(F_Tableau_Mandat, F_Tableau_Mandat[# Compte], F_Tableau_Mandat[Participation], F_Tableau_Mandat[Statut]) -- Garder les filtres ) 🚨 Problème rencontré : ✅ Le calcul de la somme trimestrielle fonctionne (J’obtiens bien la somme des 3 mois). ❌ Mais le filtre sur # Compte saute dans mon tableau croisé dynamique (TCD). ❌ J’obtiens une somme globale au lieu d’une somme par compte comptable.
🛠️ Ce que j’ai essayé : J’ai utilisé ALL(F_Tableau_Mandat[Mois]) pour supprimer uniquement le filtre sur Mois, mais le filtre # Compte saute. J’ai testé ALLEXCEPT(F_Tableau_Mandat, F_Tableau_Mandat[# Compte], F_Tableau_Mandat[Participation], F_Tableau_Mandat[Statut]), mais le problème persiste. J’ai aussi essayé une approche avec DATESBETWEEN(), mais le comportement reste erroné.
📢 Ma question : 🛠Comment puis-je modifier ma mesure DAX pour additionner correctement les 3 mois du trimestre, tout en conservant les filtres # Compte, Participation, et Statut actifs ?
📌 Merci d’avance pour votre aide ! 🙏 Toute suggestion ou correction est la bienvenue ! 🚀
Hi @Chrystelle ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
If your issue is not resolved, please share the sample data for better resolution.
Thank you!!
Hi @Chrystelle ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
If your issue is not resolved, please share the sample data for better resolution.
Thank you!!
Hi @Chrystelle ,
Thank you for reaching out to Microsoft Fabric Community.
I am unable to access the link you shared for the sample data. Could you please provide the sample data in a file format that we can access?
Thank you!!
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Hello,
Thank you for helping !
It's the first time I post a question, sorry if my question wasn't understandable.
I load an anonymised file to explain the issue here : https://docs.google.com/spreadsheets/d/1Lgz3YJeZ3ARvo4BWt6sK9KZI94OYWk3C/edit?usp=drive_link&ouid=10...
link asks for access, Please check.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
11 | |
10 | |
10 | |
10 |
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
8 |