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

Measure ignore filters

I have created a measure of type %:

 

_€_INVERSION_N_% = 
VAR _CurrentEjercicio = CONVERT( IF(MONTH(TODAY())<7, YEAR(TODAY())-1,YEAR(TODAY())),STRING)

VAR __BASELINE_VALUE 
  =CALCULATE(SUM(CV_SX_FI_CE11000[VENTA_BRUTA]),CV_SX_FI_CE11000[EJERCICIO]=_CurrentEjercicio)
VAR __VALUE_TO_COMPARE = CALCULATE(SUM(CV_SX_FI_CE11000[VENTA_BRUTA])- 
  SUM(CV_SX_FI_CE11000[DDF])),CV_SX_FI_CE11000[EJERCICIO]=_CurrentEjercicio)


RETURN
	IF(
		NOT ISBLANK(__BASELINE_VALUE) && __BASELINE_VALUE>0,
		(__VALUE_TO_COMPARE/__BASELINE_VALUE),
        IF(__VALUE_TO_COMPARE>0,1,0)
	)

 

 

I want to create similar measure but ingnoring filters but it doesn't work, it shows same date:

 

_€_INVERSION_N_%_TOTALCOMPAÑIA = 
VAR _CurrentEjercicio = CONVERT( IF(MONTH(TODAY())<7, YEAR(TODAY())-1,YEAR(TODAY())),STRING)

VAR __BASELINE_VALUE 
  =CALCULATE(SUM(CV_SX_FI_CE11000[VENTA_BRUTA]),CV_SX_FI_CE11000[EJERCICIO]=_CurrentEjercicio)
VAR __VALUE_TO_COMPARE = CALCULATE(SUM(CV_SX_FI_CE11000[VENTA_BRUTA])- 
  SUM(CV_SX_FI_CE11000[DDF])),CV_SX_FI_CE11000[EJERCICIO]=_CurrentEjercicio)

RETURN
CALCULATE(	IF(
		NOT ISBLANK(__BASELINE_VALUE) && __BASELINE_VALUE>0,
		(__VALUE_TO_COMPARE/__BASELINE_VALUE),
        IF(__VALUE_TO_COMPARE>0,1,0)
	), ALL())  

 

 

The purpose is to show a table with articles and the percentage of the article and the same percentage for all articles.

 

Captura.JPG

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi @Anonymous  , 

 

According to your description, maybe ALL() can be placed in the front, and I created a simple example to test, as follows

v-yalanwu-msft_0-1622015000735.png

_€_INVERSION_N_%_TOTALCOMPAÑIA =
VAR _CurrentEjercicio =
    CONVERT (
        IF ( MONTH ( TODAY () ) < 7, YEAR ( TODAY () ) - 1, YEAR ( TODAY () ) ),
        STRING
    )
VAR __BASELINE_VALUE =
    CALCULATE (
        SUM ( CV_SX_FI_CE11000[VENTA_BRUTA] ),
        FILTER (
            ALL ( CV_SX_FI_CE11000 ),
            CV_SX_FI_CE11000[EJERCICIO] = _CurrentEjercicio
        )
    )
VAR __VALUE_TO_COMPARE =
    CALCULATE (
        SUM ( CV_SX_FI_CE11000[VENTA_BRUTA] ) - SUM ( CV_SX_FI_CE11000[DDF] ),
        FILTER (
            ALL ( CV_SX_FI_CE11000 ),
            CV_SX_FI_CE11000[EJERCICIO] = _CurrentEjercicio
        )
    )
RETURN
    IF (
        NOT ISBLANK ( __BASELINE_VALUE )
            && __BASELINE_VALUE > 0,
        ( __VALUE_TO_COMPARE / __BASELINE_VALUE ),
        IF ( __VALUE_TO_COMPARE > 0, 1, 0 )
    )

The final output is shown below:

v-yalanwu-msft_1-1622015000737.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi @Anonymous  , 

 

According to your description, maybe ALL() can be placed in the front, and I created a simple example to test, as follows

v-yalanwu-msft_0-1622015000735.png

_€_INVERSION_N_%_TOTALCOMPAÑIA =
VAR _CurrentEjercicio =
    CONVERT (
        IF ( MONTH ( TODAY () ) < 7, YEAR ( TODAY () ) - 1, YEAR ( TODAY () ) ),
        STRING
    )
VAR __BASELINE_VALUE =
    CALCULATE (
        SUM ( CV_SX_FI_CE11000[VENTA_BRUTA] ),
        FILTER (
            ALL ( CV_SX_FI_CE11000 ),
            CV_SX_FI_CE11000[EJERCICIO] = _CurrentEjercicio
        )
    )
VAR __VALUE_TO_COMPARE =
    CALCULATE (
        SUM ( CV_SX_FI_CE11000[VENTA_BRUTA] ) - SUM ( CV_SX_FI_CE11000[DDF] ),
        FILTER (
            ALL ( CV_SX_FI_CE11000 ),
            CV_SX_FI_CE11000[EJERCICIO] = _CurrentEjercicio
        )
    )
RETURN
    IF (
        NOT ISBLANK ( __BASELINE_VALUE )
            && __BASELINE_VALUE > 0,
        ( __VALUE_TO_COMPARE / __BASELINE_VALUE ),
        IF ( __VALUE_TO_COMPARE > 0, 1, 0 )
    )

The final output is shown below:

v-yalanwu-msft_1-1622015000737.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AilleryO
Memorable Member
Memorable Member

Hi,

 

To simplify our measure you can already use DIVIDE instead of your IF and NOTISBLANK.

This will make it simpler to read.

DIVIDE function does the test and offers you an alternative result if the test failed :

A/B with test on B not blank and zero if B is null, becomes DIVIDE(A,B,0) the 0 stands for alternate result.

 

Then for your filter problems, maybe you can try, REMOVEFILTER function. But I'm not 100% sure of which type of ilters and on which columns you want to remove (comes from a slicer, from your table ?)

 

Hope this helps

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.

Top Solution Authors