Forum Discussion
Tableau Function in Power BI
- 6 years ago
Hello Anonymous
this measure won't work as a filter as it returns always a distinct count meaning a scalar value. And single scalar value can't not filtered. So you have to apply this formula as a new column in your data table and then using this new column as filter.
Hope this helps
Jimmy
Hi Anonymous ,
My recommendation is to not punch your head against the wall 😉
In PowerBI, you can filter on Measures only in a Visual filter. To achieve what you want, you could create a Calculated Table with a summarize function to get a two column table with Facilities and their distinctcounts of Orders. You can then use that to put a filter on the Page or even Report level.
However, on a single visual you can filter on a measure. For example; I have a table visual with all categories of products and I want to filter out all categories where the distinct amount of corresponding products is bigger than 3. My measure is:
DistinctCount of Products in subcategory = DISTINCTCOUNT(DimProduct[ProductKey])My table visual looks like this:
By dragging the measure to the filterpane and select "greater then 3", it will filter out all categories with 3 or less products. (in the following table visual, I have removed the measure as a column to demonstrate that it doesn't need to be visible in the Table visual to be filtered on):
Note that in PowerBI, a Slicer is a filter like any other filter. If you report contains a slicer on Facility you could add the measure to the Slicer Visual filter to not show any options where count<10. If you need the page or report filter, you will need to create a calculated table with distinct facilities and their corresponding IDs, create 1*many relationships from the calculated table to your fact/dim table and use that as a filter in the filter pane. In my example, the code would be something like this:
SubCategoriesWithDistinctCountsOfProducts = SUMMARIZECOLUMNS(DimProduct[ProductSubcategoryKey], "CountOfProducts", DISTINCTCOUNT(DimProduct[ProductKey])) Let me know if this helps you out 🙂
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
- Anonymous6 years agoNot applicable
Thank you for the detailed response. I'm going to give this a try this evening and see if it produces the desired affect.
-Micah
- JarroVGIT6 years agoResident Rockstar
No Problem, just don't forget to mark it as a solution if it does fit your needs (more than 1 response can be your solution) for others with similar questions to find the answer quickly.
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂