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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Alexis-Edin
Regular Visitor

Create a measure witout filters

Hi everybody, 

I'm wondering if it's possible to create a measure without the filters which are in the rapport. 
Better explanations : 
My tables are filtering by a year table, in my case is 2021. So my measures are filtered to. 

But I would like to remove this filter and put a new one only in the new measure.

I tried this :


test =
CALCULATE (
COUNT ( 'Utilisation des offres'[Clé primaire NIA + Annéee + ID Offre] ),
FILTER ( Offre_ID, Offre_ID[ID_Offre] = 8 ),
FILTER ( Type_OD, Type_OD[ID_typeOD] = "1" ),
ALL( 'Utilisation des offres'[ID_annee] ),
FILTER( 'Utilisation des offres', 'Utilisation des offres'[ID_annee] = [Id_Année_mesure] )
) / [NB_actifs_filtres]

"Id_année mesure" correspond to the year 2022.

The result is "ampty"

Thank in advance for your help

 

 

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @Alexis-Edin ,

 

You can try using ALLSELECTED() instead of ALL()

The ALLSELECTED function removes context filters from columns and rows in the current query, while retaining all other context filters or explicit filters.

ALLSELECTED function (DAX) - DAX | Microsoft Learn

test =
CALCULATE (
COUNT ( 'Utilisation des offres'[Clé primaire NIA + Annéee + ID Offre] ),
FILTER ( Offre_ID, Offre_ID[ID_Offre] = 8 ),
FILTER ( Type_OD, Type_OD[ID_typeOD] = "1" ),
ALLSELECTED( 'Utilisation des offres'[ID_annee] )
) / [NB_actifs_filtres]

If I have misunderstood your meaning, please provide your pbix file without privacy information and desired output.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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