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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
selpaqm
Helper V
Helper V

Measure Stop Filtering For Sub columns

Hi,

 

I have a table as below. 

CustomerBrandSales Measure
aTT2=(2/(2+3+5+1)
bTT3=(3/(2+3+5+1)
cTT5=(5/(2+3+5+1)
dTT1=(1/(2+3+5+1)
eTC6=(6/(6+4)
fTC4=(4/(6+4)

Measure=divide(calculate(sum(sales),filter(table_1,customer=customer)),calculate(sum(sales),filter(table_1,brand=brand)))

 

however, when I create a table for customer

CustomerMeasure
a1
b1
c1
d1
e1
f1

 

so how I fixed it

2 ACCEPTED SOLUTIONS
v-angzheng-msft
Community Support
Community Support

Hi, @selpaqm 

 

Try to create a measure like this:

__Measure =
VAR _customer =
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Customer] = MAX ( 'Table'[Customer] )
        )
    )
VAR _brand =
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Brand] = MAX ( 'Table'[Brand] ) )
    )
RETURN
    DIVIDE ( _customer, _brand )

result:

vangzhengmsft_0-1629704186605.png

It is recommended to use percentage formatting, otherwise you will only see 0 or 1

vangzhengmsft_1-1629704466193.png

Please refer to the attachment below for details

 

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
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

@selpaqm 

 

 

measure1:

__divide = 
var _customer=CALCULATE(SUM('Table'[Sales]),FILTER(ALLSELECTED('Table'),'Table'[Customer]=MAX('Table'[Customer])))
var _brand=CALCULATE(SUM('Table'[Sales]),FILTER(ALL('Table'),'Table'[Brand]=MAX('Table'[Brand])))
var _divide=DIVIDE(_customer,_brand)
return _divide

measure2:

_result = 
VAR _sum =
    SUMMARIZE ( 'Table', [Customer], [Brand], [Sales], "1", [__divide] )
RETURN
    SUMX ( _sum, [1] )

result:

vangzhengmsft_0-1629770751838.png

 

 Best Regards,
Community Support Team _ Zeon Zheng

View solution in original post

8 REPLIES 8
v-angzheng-msft
Community Support
Community Support

Hi, @selpaqm 

 

Try to create a measure like this:

__Measure =
VAR _customer =
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Customer] = MAX ( 'Table'[Customer] )
        )
    )
VAR _brand =
    CALCULATE (
        SUM ( 'Table'[Sales] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Brand] = MAX ( 'Table'[Brand] ) )
    )
RETURN
    DIVIDE ( _customer, _brand )

result:

vangzhengmsft_0-1629704186605.png

It is recommended to use percentage formatting, otherwise you will only see 0 or 1

vangzhengmsft_1-1629704466193.png

Please refer to the attachment below for details

 

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-angzheng-msft thanks for reply works on table. when using a filter on slicer. it shows as 100% again. is there any solution for it? also total is not correct.

@selpaqm 

 

 

measure1:

__divide = 
var _customer=CALCULATE(SUM('Table'[Sales]),FILTER(ALLSELECTED('Table'),'Table'[Customer]=MAX('Table'[Customer])))
var _brand=CALCULATE(SUM('Table'[Sales]),FILTER(ALL('Table'),'Table'[Brand]=MAX('Table'[Brand])))
var _divide=DIVIDE(_customer,_brand)
return _divide

measure2:

_result = 
VAR _sum =
    SUMMARIZE ( 'Table', [Customer], [Brand], [Sales], "1", [__divide] )
RETURN
    SUMX ( _sum, [1] )

result:

vangzhengmsft_0-1629770751838.png

 

 Best Regards,
Community Support Team _ Zeon Zheng

@v-angzheng-msft it is really good working. thanks.

Greg_Deckler
Community Champion
Community Champion

@selpaqm Try:

Measure=divide(calculate(sum(sales),filter(ALL(table_1),customer=customer)),calculate(sum(sales),filter(ALL(table_1),brand=brand)))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  unfortunately gives 1 as result again

amitchandak
Super User
Super User

@selpaqm , Try a measure like

 

divide(sum(table[Sales]), calculate(sum(table[Sales]), filter(allselected(Table), Table[Brand]= max(Table[Brand]))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak  unfortunately gives 1 as result again

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.