Help needed : Dax calculate table

Ehly Francois 0 Points de réputation
2024-03-15T12:15:38.8733333+00:00

Hi, I need help with a DAX issue. I have a table with the following columns: YEAR MONTH, ACTUALS, and FORECAST. The YEAR MONTH table is composed as follows: 23-01; 23-02; ... ; 23-12 ; 23-01; 23-02; ... ; 23-12... And the news column has values from 23-01 to 24-02. The Forecast column has values for all months of each year. I want to calculate the sum of the actuals, but if for example there are months when the actuals are not available for a few months be replaced in the calculation of the sum by their values in Forecast. Here's a screenshot of my table. Here is the formul : 

Act = CALCULATE(sum(MasterFacts[Value]),MasterFacts[Scenario]="Actuals")

Fcst = CALCULATE(sum(MasterFacts[Value]),MasterFacts[Scenario]="Forecast")

LE MTD =

    CALCULATE(

        IF (

            SELECTEDVALUE(MasterFacts[StartDate]) <= DATE(YEAR(TODAY()), MONTH(TODAY()) - 1, DAY(TODAY())),

            [Act],

            [Fcst]

        )

    )

LE FY = CALCULATE([LE MTD],ALLEXCEPT(Dates,Dates[Date]))

Microsoft Q&A
Microsoft Q&A
Utilisez cette étiquette pour partager des suggestions, des demandes de fonctionnalités et des bogues avec l'équipe Microsoft Q&A. L'équipe Microsoft Q&A évaluera régulièrement vos commentaires et fournira des mises à jour en cours de route.
80 questions
0 commentaires Aucun commentaire
{count} votes