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.
Hello,
I have a scenario where i need the distinct value count in a column according to the dates selected in the slicer.
Example:
I have used the following DAX measure( count_2) to get the count of distinct item locations according to the dates selected in the slicer.
But as you can see in the screenshot it shows the count of item location "ZZ" as 1.
I want it show 2 as it is appearing two times in the output.
Here is the date slicer applied:
Any help would be much appreciated.
Thanks
Solved! Go to Solution.
The columns you add to your table act as filters. In your case, that includes the Date and Branch columns. To remove specific filters, you need to use a variant of the ALL() function (or REMOVEFILTERS()). To get 2 from your data, I think you will need the following
New Count = CALCULATE([count_2], ALL(Table[Branch], Table[Branch Description]), ALLSELECTED('Date'[Date])
Note that the Date one uses ALLSELECTED. That will remove the filter on that column but just in the table (it will keep the filter on the Dates selected in your slicer).
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hello @mahoneypat
I can remove count_2 as this might not be required, i basically need a count of different item locations in the report as per the selected dates.
I need to get same the output similar to the filter of item Location in filter pane:
Hi @Anonymous ,
Try if this works
LocationsCount =
COUNTROWS (
FILTER (
ALL ( ItemLocation[itemlocation] ),
ItemLocation[itemlocation]
= MAX ( ItemLocation[itemlocation] )
)
)
Regards,
Harsh Nathani
This does not work:
The measure count_2 works as expected when i remove all the fields:
But as soon as i bring branch or any other field it fails to work.
I need to ingore all the other fields as filters .
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 |
---|---|
43 | |
23 | |
21 | |
15 | |
15 |
User | Count |
---|---|
46 | |
31 | |
30 | |
18 | |
18 |