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.
Hi everyone,
I have created a measure where I count all sales that have been sold with 0 discount. But my problem is that it also counts all the blank fields in the specific column. Below is my measure:
Measure = CALCULATE([Total Sales], Sales[Discount] = 0)
When I write 0 then it takes 0 AND blank. How can I count all the 0 from the column "Discount" but not include blank fields?
Solved! Go to Solution.
Hello @seryil ,
You must use the strictly equal sign, so your measure should be:
Measure = CALCULATE([Total Sales], Sales[Discount] == 0)
check the explanation at the following link:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@Anonymous , Try
CALCULATE([Total Sales], Filter(Sales,not(isblank(Sales[Discount] )) && Sales[Discount] = 0))
or
CALCULATE([Total Sales], coalesce(Sales[Discount],-1) = 0)
Hello @seryil ,
You must use the strictly equal sign, so your measure should be:
Measure = CALCULATE([Total Sales], Sales[Discount] == 0)
check the explanation at the following link:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCopying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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 |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |