Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
How to achieve the SUMIF in DAX. Condition just contains some string.
For example, =SUMIF($C:$C,"*SPARE PART*",$F:$F)
How to Describe this in DAX?
Solved! Go to Solution.
Hi,
According to your description, i create a sample to test:
For example, if you want to sum the values that [String] contains "AB", please try to create this column first:
Column = IF(FIND("AB",'Table'[String],1,0)<>0,1,0)
Then try this measure:
Measure = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Column]=1))
The result shows:
Above is the function By DAX like the SUMIF in Excel.
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi
Hi,
According to your description, i create a sample to test:
For example, if you want to sum the values that [String] contains "AB", please try to create this column first:
Column = IF(FIND("AB",'Table'[String],1,0)<>0,1,0)
Then try this measure:
Measure = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Column]=1))
The result shows:
Above is the function By DAX like the SUMIF in Excel.
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi
Hey @Schwinn123 ,
you can use a measure like this:
SUMX(
VALUES('<tablename>'[name of the column in C])
, IF(
FIND(...)
, CALCULATE(SUM('<tablename>'[name of the column in F]))
, BLANK()
)
Here you will find an explanation to all the DAX functions: https://dax.guide/
Hopefully, this gets you started.
Regards,
Tom
User | Count |
---|---|
101 | |
90 | |
78 | |
70 | |
69 |
User | Count |
---|---|
110 | |
96 | |
95 | |
74 | |
71 |