Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I want to write a dax formula for calculating volume, by filtering out sales group 011, 010, 009.
After that I want to filter out below values from the above mesaure:
filter out customername and below are my customer name that I want to filter out and also fiter out 010.
Filter out
Customer A
Customer B
How to write this dax in order to get correct result?
Solved! Go to Solution.
In your statement above you are INcluding all values by sales group
try
Measure = CALCULATE(SUM(ZSD_MAT_MARGIN_Q003[Sales Volume KL]), FILTER(ZSD_MAT_MARGIN_Q003,
(ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01]= "011" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "010" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "009") && [Customer] <> "Value A" && [Customer] <> "Value B"
))
do not hesitate to give a kudo to useful posts and mark solutions as solution
Hi @Anmolgan
data model is not clear from your definition, but try something like
Measure =
CALCULATE(
SUM([Value]);
FILTER(ALL('Table');NOT ('Table'[Sales Group] IN {"009","010","011"}) && NOT('Table'[Sales Group] IN {"Customer A","Customer B"}))
)
do not hesitate to give a kudo to useful posts and mark solutions as solution
@az38 I had created below measure for filtering out sales group
does your table ZSD_MAT_MARGIN_Q003 have a relationship with Customer table?
If so, it could be enough to add in filter statement || RELATED([Customer]) = "Value A" like this
Measure = CALCULATE(SUM(ZSD_MAT_MARGIN_Q003[Sales Volume KL]), FILTER(ZSD_MAT_MARGIN_Q003, ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01]= "011" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "010" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "009" || RELATED('Customer Table'[Customer]) = "Value A" || RELATED('Customer Table'[Customer]) = "Value B"))
do not hesitate to give a kudo to useful posts and mark solutions as solution
@az38 Everything is present in my table, I only have 1 table, why I should use RELATED I dont want to include those values in my existing dax, I want to exclude those values.
In your statement above you are INcluding all values by sales group
try
Measure = CALCULATE(SUM(ZSD_MAT_MARGIN_Q003[Sales Volume KL]), FILTER(ZSD_MAT_MARGIN_Q003,
(ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01]= "011" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "010" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "009") && [Customer] <> "Value A" && [Customer] <> "Value B"
))
do not hesitate to give a kudo to useful posts and mark solutions as solution
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |