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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

CALCULATE a SUM with FILTER

Hi everyone,

 

I have been trying the whole day to sum a column applying some filter on it. I got the first formula that I'm using the value of a slicer in a condition with a lookup to get the correct date format, and then another simple condition.

 

CALCULATE( 

SUM( GRC_F_KPI[KPI_VALUE] );
FILTER( GRC_F_KPI; GRC_F_KPI[DATE] = LOOKUPVALUE(GRC_F_KPI[DATE]; Test_Period[MONTHOFYEAR]; ALLSELECTED(Test_Period[MONTHOFYEAR])) && GRC_F_KPI[COD_KPI] = "CB-11")
)

 

To this value I would like to deduct the month before value. In order to get that I'm using this formula but it does't work.

 

CALCULATE( 

SUM( GRC_F_KPI[KPI_VALUE] );
FILTER( GRC_F_KPI; GRC_F_KPI[DATE] = EDATE ( LOOKUPVALUE( GRC_F_KPI[DATE]; Test_Period[MONTHOFYEAR]; ALLSELECTED(Test_Period[MONTHOFYEAR] ) ); -1) && GRC_F_KPI[COD_KPI] = "CB-11")
)

 

Thanks for your help.

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Kindly share your sample data and excepted result to me.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Eventually, it was a filter problem. Thanks anyway.

Hi @Anonymous,

 

Kindly mark your answer as solution to close the case please. thanks in advance.

 

Regards.

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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