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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Louay
New Member

Cumul des actions

Cumul act =
VAR SelectedOrigine = SELECTEDVALUE('Cumul Actions'[Origine première])
VAR SelectedProcessus = SELECTEDVALUE('Cumul Actions'[Processus])

RETURN
IF (
    ISFILTERED('Cumul Actions'[Origine première]) && ISFILTERED('Cumul Actions'[Processus]) ,
    CALCULATE (
        COUNT('Cumul Actions'[Processus]),
        FILTER (
            ALL('Cumul Actions'),
            'Cumul Actions'[Date] <= MAX('Cumul Actions'[Date])
                && 'Cumul Actions'[Origine première] = SelectedOrigine
                && 'Cumul Actions'[Processus] = SelectedProcessus
        )
    ),
    CALCULATE (
        COUNT('Cumul Actions'[Processus]),
        FILTER (
            ALL('Cumul Actions'),
            'Cumul Actions'[Date] <= MAX('Cumul Actions'[Date])
        )
    )
)
 
Bonjour, J'ai utiliser ce code pour calculer le cumul des action au cours du temps tout en prendre en consideration des filtres processus et origine premiere selectionné(s). Sans selectionné auccun filtre ça marche correctement et calculer le cumul générale mais lors de selection d'un ou plusieurs filtres il affiche seulement les mois concernés par ce filtre mais avec les valeurs generales.
Louay_0-1708347375338.png

 

Louay_1-1708347400908.png

 

1 ACCEPTED SOLUTION
Louay
New Member

I find the solution 

Cumuls des actions =
VAR SelectedOrigine = SELECTEDVALUE('Actions'[Origine première])
VAR SelectedProcessus = SELECTEDVALUE('Actions'[Processus])

RETURN
IF (
    ISFILTERED('Actions'[Origine première]) && ISFILTERED('Actions'[Processus]),
    CALCULATE (
        COUNT('Actions'[Processus]),
        FILTER (
            ALLSELECTED('Actions'),
            'Actions'[Année/Mois] <= MAX('Actions'[Année/Mois])
                && 'Actions'[Origine première] = SelectedOrigine
                && 'Actions'[Processus] = SelectedProcessus
        )
    ),
    CALCULATE (
        COUNT('Actions'[Processus]),
        FILTER (
            ALLSELECTED('Actions'),
            'Actions'[Année/Mois] <= MAX('Actions'[Année/Mois])
        )
    )
)

View solution in original post

2 REPLIES 2
Louay
New Member

I find the solution 

Cumuls des actions =
VAR SelectedOrigine = SELECTEDVALUE('Actions'[Origine première])
VAR SelectedProcessus = SELECTEDVALUE('Actions'[Processus])

RETURN
IF (
    ISFILTERED('Actions'[Origine première]) && ISFILTERED('Actions'[Processus]),
    CALCULATE (
        COUNT('Actions'[Processus]),
        FILTER (
            ALLSELECTED('Actions'),
            'Actions'[Année/Mois] <= MAX('Actions'[Année/Mois])
                && 'Actions'[Origine première] = SelectedOrigine
                && 'Actions'[Processus] = SelectedProcessus
        )
    ),
    CALCULATE (
        COUNT('Actions'[Processus]),
        FILTER (
            ALLSELECTED('Actions'),
            'Actions'[Année/Mois] <= MAX('Actions'[Année/Mois])
        )
    )
)
amitchandak
Super User
Super User

@Louay , In such case, it is better to have a separate date table, joined with the date of your table. And use fields of date table in measure, visual, and slicers

 

Then you can use measures like

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date])))

Cumm Based on Date = CALCULATE([Net], Window(1,ABS,0,REL, ALL('date'[date]),ORDERBY('Date'[date],ASC)))

Cumm Based on Date = CALCULATE([Net], Window(1,ABS,0,REL, ALLSELECTED('date'[date]),ORDERBY('Date'[date],ASC)))

 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.