Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello everyone,
I need your help with the following problem.
In the table below I would like to create a measure that gives me a separate count when the sum of the number column is less than 20.
In this case I should have a thumbnail that displays 2, because the sum of "aaa" and "ccc" is less than 20.
What's more, the Date column is also a page slicer in the report, so will the measurement be dynamic depending on the choice in the slicer? All data are in the same table.
Solved! Go to Solution.
For your information, I succeeded in doing this:
hi, @UserSam123
try below
just adjust your table name
output =
var a =ADDCOLUMNS(
SUMMARIZE('Table','Table'[date],'Table'[name]),
"d",CALCULATE(SUM('Table'[number]))
)
RETURN
COUNTX(FILTER(a,[d]<20),'Table'[name])
For your information, I succeeded in doing this:
To create a measure that gives you a separate count when the sum of the number column is less than 20, you can use the following DAX formula:
Measure = CALCULATE(DISTINCTCOUNT(Table[Name]), SUM(Table[Number]) < 20)
This formula uses the CALCULATE function to filter the table based on the condition that the sum of the Number column is less than 20. The DISTINCTCOUNT function then counts the number of unique values in the Name column that meet this condition.
Regarding your question about the page slicer, the measure will be dynamic depending on the choice in the slicer as long as all the data is in the same table.
I hope this helps! Let me know if you have any further questions.
Hello,
Thanks for the feedback, but I've already used this formula and it didn't work, which is why I'm coming to you.
I use this one and it returns null. When I use yours, it sends me this error message: True/False expression doesn't specify a column
I’m sorry to hear that the formula I provided didn’t work for you. The error message “True/False expression doesn’t specify a column” usually occurs when each True/Fal...1.
Based on the screenshot you provided, it looks like you are using an IF statement in your formula. If this is the case, you may need to wrap your IF statement in a FILTER function to fix the issue 1. Here’s an example of how you can modify the formula:
Measure = CALCULATE(DISTINCTCOUNT(Table[Column]), FILTER(Table, SUM(Table[Number]) < 20))
This formula uses the FILTER function to filter the table based on the condition that the sum of the Number column is less than 20. The DISTINCTCOUNT function then counts the number of distinct values in the Column column for the filtered table.
Regarding your question about the Date column being a page slicer, the measure will be dynamic depending on the choice in the slicer as long as all the data is in the same table.
I hope this helps! Let me know if you have any further questions.
I don't understand why you're asking me to change my formula for yours when there's absolutely no change between mine and yours.
What's more, this formula doesn't work, it returns "null".
User | Count |
---|---|
22 | |
19 | |
12 | |
10 | |
10 |
User | Count |
---|---|
31 | |
25 | |
15 | |
13 | |
12 |