formule Dax

  • formule Dax

    Posté par Séverine sur 16 octobre 2024 à 17h06

    Bonjour,

    Je cherche une formule Dax qui me permet de prendre la version la plus récente de chacun de mes produits qui doivent être en état ‘production’ pour ensuite calculer le nombre de données manquantes dans mes autres colonnes concernées.

    Exemple de fichier que je vais avoir:

    <table style=”border-collapse: collapse; width: 390pt;” border=”0″ width=”522″ cellspacing=”0″ cellpadding=”0″><colgroup><col style=”width: 65pt;” width=”87″> <col style=”width: 65pt;” width=”87″> <col style=”width: 65pt;” span=”4″ width=”87″> </colgroup>
    <tbody>
    <tr style=”height: 16.0pt;”>
    <td style=”height: 16.0pt; width: 65pt;” width=”87″ height=”21″>Produit</td>
    <td class=”xl63″ style=”width: 65pt;” width=”87″>Version </td>
    <td style=”width: 65pt;” width=”87″>Date de MEP</td>
    <td style=”width: 65pt;” width=”87″>Projet</td>
    <td style=”width: 65pt;” width=”87″>Type</td>
    <td style=”width: 65pt;” width=”87″>Etat</td>
    </tr>
    <tr style=”height: 16.0pt;”>
    <td style=”height: 16.0pt;” height=”21″>A</td>
    <td class=”xl63″>1.0.1</td>
    <td class=”xl64″ align=”right”>19/12/2023</td>
    <td> </td>
    <td>Client</td>
    <td>Emergence</td>
    </tr>
    <tr style=”height: 16.0pt;”>
    <td style=”height: 16.0pt;” height=”21″>A</td>
    <td class=”xl63″>1.1</td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td>Production</td>
    </tr>
    <tr style=”height: 16.0pt;”>
    <td style=”height: 16.0pt;” height=”21″>B</td>
    <td class=”xl63″>2018</td>
    <td> </td>
    <td>HPC</td>
    <td> </td>
    <td>Production</td>
    </tr>
    <tr style=”height: 16.0pt;”>
    <td style=”height: 16.0pt;” height=”21″>C</td>
    <td class=”xl63″>2022</td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td>Production</td>
    </tr>
    <tr style=”height: 16.0pt;”>
    <td style=”height: 16.0pt;” height=”21″>D</td>
    <td class=”xl63″>14.9</td>
    <td> </td>
    <td>F3</td>
    <td> </td>
    <td>Emergence</td>
    </tr>
    <tr style=”height: 16.0pt;”>
    <td style=”height: 16.0pt;” height=”21″>D</td>
    <td class=”xl63″>18</td>
    <td> </td>
    <td> </td>
    <td>Client</td>
    <td>Production</td>
    </tr>
    <tr style=”height: 16.0pt;”>
    <td style=”height: 16.0pt;” height=”21″>D</td>
    <td class=”xl63″>18.0.8</td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td>Production</td>
    </tr>
    <tr style=”height: 16.0pt;”>
    <td style=”height: 16.0pt;” height=”21″>E</td>
    <td class=”xl63″>2017</td>
    <td> </td>
    <td>SZC</td>
    <td> </td>
    <td>emergence</td>
    </tr>
    <tr style=”height: 16.0pt;”>
    <td style=”height: 16.0pt;” height=”21″>E</td>
    <td class=”xl63″>2020</td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td>emergence</td>
    </tr>
    <tr style=”height: 16.0pt;”>
    <td style=”height: 16.0pt;” height=”21″>E</td>
    <td class=”xl63″>2021</td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td>emergence</td>
    </tr>
    <tr style=”height: 16.0pt;”>
    <td style=”height: 16.0pt;” height=”21″>E</td>
    <td class=”xl63″>2024</td>
    <td class=”xl64″ align=”right”>23/01/2024</td>
    <td> </td>
    <td> </td>
    <td>Production</td>
    </tr>
    </tbody>
    </table>

    Si je n’ai que les colonnes produit et version, avec la fonction max je peux récupérer la version la plus récente et je peux faire un filtre avec l’état ‘production’, par contre je n’arrive pas à compter le nombre de Date de MEP vide par exemple uniquement pour les lignes retenues.

    Merci pour votre aide

    Jonathan a répondu Il y a 1 jour, 16 heures 2 Membres · 1 Réponse
  • 1 Réponse
  • Jonathan

    Membre
    16 octobre 2024 à 17h42

    Bonjour Séverine,

    Je n’ai pas tout compris de la question mais voici un début de réponse qui permettrait de récupérer la dernière version pour chaque produit avec un état “Production”.

    <pre class=”language-markup”>Derniere Version =
    CALCULATE (
    MAX ( Produits[Version] ),
    ALLEXCEPT (
    Produits,
    Produits[Produit]
    ),
    Produits[Etat] = "Production"
    )

Connectez-vous pour répondre.