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
Anonymous
Not applicable

Deactivate filter in measure but keep selectedValue to create new filter

Hello,

I need your help. I have a table with a notion of parent and child (Region / Department / City). When we select a parent entity, I would like to display a table with the detail of the indicators for the child entities but also the values ​​for the parent entity. For child entities, it works well but not for parents.

 

Here is what I did but it returns an empty value:

 
Cmll_0-1626863643949.png

 

 

Cmll_1-1626859331814.pngCmll_2-1626859396686.png

 

Thank's for your help

1 ACCEPTED SOLUTION
PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous ,

 

I'm not totally sure this is what you're after.  Hopefully I've interpreted your question correctly.

 

It looks to me like in your sample data the total of VALEUR for the children don't add up to the VALEUR for the parent.  I guess that's the issue you're trying to solve?  Just using SUM(NEW_TABLE[VALEUR]) in the matrix would result in the sum of the children's value being displayed for the parent.

 

Here's a measure to give the parent's amount for parent rows and children's amount for children.

New Measure =
IF(
NOT ISINSCOPE(NEW_TABLE[LIB_ENTITE]),
CALCULATE(
SUM(NEW_TABLE[VALEUR]),
ALL(NEW_TABLE[ENTITE_PARENT]),
TREATAS(VALUES(NEW_TABLE[ENTITE_PARENT]), NEW_TABLE[LIB_ENTITE])
),
SUM(NEW_TABLE[VALEUR])
)
 
Here's the results of your sample data, with a comparison against a simple SUM of VALUER.
PaulOlding_0-1626870933637.png

 

View solution in original post

4 REPLIES 4
PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous ,

 

I'm not totally sure this is what you're after.  Hopefully I've interpreted your question correctly.

 

It looks to me like in your sample data the total of VALEUR for the children don't add up to the VALEUR for the parent.  I guess that's the issue you're trying to solve?  Just using SUM(NEW_TABLE[VALEUR]) in the matrix would result in the sum of the children's value being displayed for the parent.

 

Here's a measure to give the parent's amount for parent rows and children's amount for children.

New Measure =
IF(
NOT ISINSCOPE(NEW_TABLE[LIB_ENTITE]),
CALCULATE(
SUM(NEW_TABLE[VALEUR]),
ALL(NEW_TABLE[ENTITE_PARENT]),
TREATAS(VALUES(NEW_TABLE[ENTITE_PARENT]), NEW_TABLE[LIB_ENTITE])
),
SUM(NEW_TABLE[VALEUR])
)
 
Here's the results of your sample data, with a comparison against a simple SUM of VALUER.
PaulOlding_0-1626870933637.png

 

Anonymous
Not applicable

Hi @PaulOlding 

 

Thank's so much it seems to work 🙂

However, I will need to use this measure to create several measures. (I want to create metrics for some values ​​in the co_indic column) but my new metric doesn't seem to work.

 

Measure = CALCULATE([New Measure],FILTER(NEW_TABLE,NEW_TABLE[CO_INDIC]="ACT0860"))

 

 

I want to have a table like this but I want to put the names of the indicators in place of their codes and not display the Total row (last row of the table).

 

Cmll_0-1626872787185.png

 

Thanks

 

@Anonymous 

Can't you put CO_INDIC in the Column field well of a matrix visual?  No need to have separate measures then.

PaulOlding_0-1626873871133.png

You mention wanting a description rather than the code.  If you don't have that in your model you could add it as an extra table.  A table with 2 columns: CO_INDIC, DESCRIPTION that has one row per CO_INDIC.  Create a relationship between this and NEW_TABLE on CO_INDIC.

 

If you really want to have searate measures then try this syntax:

ACT0850 =
CALCULATE(
[New Measure],
NEW_TABLE[CO_INDIC] = "ACT0850"
)
Anonymous
Not applicable

@PaulOlding Thank's you so much ! 🙂

It's perfect !

 

Have a Nice day 🙂

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors