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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Help with filter on a graph

Hello everyone, i would like to get some help, but first I will give some context (the names are in French sorry)

 

SemDateNomPrénomMatriculeStructure  DuréeLibelléCréneau HoraireACH160 (1ere incluses)UrgencesRETABDITDANA analyser EPODA régulariserMHS Point coupé ACHDITINTER APPAREILS
2918/07/2023GUEZZENINAYAI56375Clermont Ferrand08:0011:4503:45Atelier sur site08:00-11:45            


So here you have an exemple of my source for my BI, i have around 4000 lines like that

 

The idea is to sum the "Durée" (time spent) by day in order to understand how many hours were done each day (the cross is use the select the type of action realised), first i created a new table with days from 01/01/2023 to 12/31/2025 linked with the origin table on the Dates and then i wrote this program :

ACH 160 durée =
SUMX(FILTER(
    'Table 1 (CONSIGNES)',
    'Table 1 (CONSIGNES)'[ACH160 (1ere incluses)] = "x" &&
    'Table 1 (CONSIGNES)'[Date]=Calendrier[Date]
), 'Table 1 (CONSIGNES)'[Durée])*24

I have 8 columns similar with every different type of action and i'm fine with it, the problem come when i put these column in a line graph, everything work but when i filter with "Nom" (Names) the data keep taking informations from other lines than the ones with the right name (i know it because with a filter i have people with 50 hours of an action while in reality they are at 2hours or even 0)
AlexandreG63000_0-1692010557363.png

and with the filter

AlexandreG63000_1-1692010592034.png

I tried things like creating a new table with only the names and give it the priority over the others tables but nothing work

the thing strange here, it's when I create a new column with this program :

 
BEL ACH 160 durée =
VAR duree = SUMX(FILTER(
        'Table 1 (CONSIGNES)',
        'Table 1 (CONSIGNES)'[ACH160 (1ere incluses)] = "x" &&
        'Table 1 (CONSIGNES)'[Date]=Calendrier[Date] &&
        'Table 1 (CONSIGNES)'[Nom]="BEL"
    ), 'Table 1 (CONSIGNES)'[Durée])
RETURN
    duree*24
 
I get a column with the right amount of time for each day, this is what I want when i use the visual on my page
There is like 80 names so it would be too complicated and ugly on a graph to create 80 columns
 
I don't know what I can do to solve my problem, if someone has an idea of what I can do it would be amazing, if you any information, don't hesitate to ask if it can help
 
Thanks to anyone who will take time to help me,
 
Alexandre



1 REPLY 1
Vijay_Chethan
Super User
Super User

Hello

you can use measures instead of columns to calculate sum of time or what ever calculation you are doing

the reason being once the value is calculated in column that doesnt change

so iif you use measureyou wont face any issue:
for example 

ACH 160 durée =

SUMX(FILTER(

'Table 1 (CONSIGNES)',

[ACH160 (1ere incluses)] = "x" &&

[Date]=selectedvalue(Calendrier[Date])

), [Durée])*24
in the line chart this measure takes the axis value (calander date) which you used in x axis and then gives sum, now answer varies based on filter applied and you can use it for other 8 columns as well

 

 

if this helps , please mark as solution

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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