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 August 31st. Request your voucher.

Reply
UserSam123
Helper I
Helper I

Count measure with a filter measure

Hello everyone,

 

I'm coming to you because I need help with a measure that refers to other measures.

 

UserSam123_0-1689008525535.png

 

In this table, the first column, "StatutVar", is a measurement that SuperUser @tamerj1  helped me to make, thanks to him.

From this StatusVar measurement a second one is created, "bo_dossier_...".  

https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/column-calculated-in-relation-to-ano...

 

Finally, the middle column is a distinctCount on a column when the measure "bo_dossier-..." = true. As you can see, there are rows where the bo_dossier is false and I have 2s when I should have nothing. Can you please help me?

 

Here are my measures:

StatutVar:=
VAR CurrentIDTable =
CALCULATETABLE ( DISTINCT ( GESTION[C_STATUT_DOSSIER]), ALLSELECTED() ,VALUES ( GESTION[ID_DOSSIER]) )
RETURN
IF(
--NOT ISEMPTY ( Gestion ) &&
ISEMPTY ( EXCEPT ( { "ANNULE" }, CurrentIDTable ) ) ,
IF (
NOT ISEMPTY ( INTERSECT ( { "ACCEPTE", "PAYE" }, CurrentIDTable ) ),
1,
BLANK()
),
BLANK()
)

 

 

bo_dossier_servi_num agent mesure:=IF(ISBLANK([StatutVar])= true,VALUES(GESTION[BO_DOSSIER_SERVI]),FALSE)

 

Variable agents servis:= CALCULATE((DISTINCTCOUNT(GESTION[C_NUM_AGENT])),FILTER(GESTION,[bo_dossier_servi_num agent mesure]=true))+CALCULATE(CALCULATE(DISTINCTCOUNT(GESTION[C_NUM_CONJOINT]),GESTION[C_NUM_CONJOINT]<>BLANK()),FILTER(GESTION,[bo_dossier_servi_num agent mesure]=true))

 

When I use this measure I get the right lines, but I no longer have a total result. I should have 2 in total result here :

Variable agents servis test = IF([StatutVar]=1,BLANK(),[Variable agents servis])

 

UserSam123_1-1689009120434.png

 

0 REPLIES 0

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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