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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Evelin_
Helper I
Helper I

TREATAS combining filters

Hello Community! 

 

I did not find any proper topic for my question, can you help me?

I started to use TREATAS in some of my dax, intead of selectedvalue as Im developing with more function my dashboard.Now I should filter for not only versions but also for a different column, and I could not connect it with TREATAS. 

So far I had this formulas working:

VAR 1 =

CALCULATE (

    SUM ( Data[Volume] ),

    Data[Version] = "PLAN"

        && Data[PACK] = "BOX"

)

VAR 2 =

CALCULATE (

    SUM ( Data[Volume] ),

    Data[Version] = "PLAN"

)

VAR SHARE = DIVIDE(1, 2, -1) +0

 

How Can I turn it into a workinf formula with TREATAS? I can not join the PACK filter in this:

VAR 1 =

CALCULATE (

    SUM ( Data[Volume] ),

    TREATAS ( VALUES ( Version2[Version2] ), Data[Version])

PACK???

)

VAR 2 =

CALCULATE (

    SUM ( Data[Volume] ),

    TREATAS ( VALUES ( Version2[Version2] ), Data[Version])

)

VAR SHARE = DIVIDE(1, 2, -1) +0

 

Thank you in advance!

Evelin

1 ACCEPTED SOLUTION
pankajnamekar25
Super User
Super User

Hello @Evelin_ 

 

You can use below DAX code

VAR _1 =

CALCULATE (

    SUM ( Data[Volume] ),

    TREATAS ( VALUES ( Version2[Version2] ), Data[Version] ),

    Data[PACK] = "BOX"

)

 

VAR _2 =

CALCULATE (

    SUM ( Data[Volume] ),

    TREATAS ( VALUES ( Version2[Version2] ), Data[Version] )

)

 

VAR SHARE =

DIVIDE ( _1, _2, -1 ) + 0

 

RETURN

    SHARE

 

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

View solution in original post

2 REPLIES 2
Evelin_
Helper I
Helper I

Thank you! this works, and actually easier thank I thought 😄

pankajnamekar25
Super User
Super User

Hello @Evelin_ 

 

You can use below DAX code

VAR _1 =

CALCULATE (

    SUM ( Data[Volume] ),

    TREATAS ( VALUES ( Version2[Version2] ), Data[Version] ),

    Data[PACK] = "BOX"

)

 

VAR _2 =

CALCULATE (

    SUM ( Data[Volume] ),

    TREATAS ( VALUES ( Version2[Version2] ), Data[Version] )

)

 

VAR SHARE =

DIVIDE ( _1, _2, -1 ) + 0

 

RETURN

    SHARE

 

 

Thanks,
 Pankaj Namekar | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.