Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Tableau Function in Power BI

I've recently been tasked with moving some of my Tableau Dashboards over to Power BI and like a lot of the users on here, I'm struggling getting some stuff involving LOD's to function in DAX. It's pretty frustrating. Here's my current issue that I've been stuck on for way to long;

 

In Tableau: I have an LOD function; { FIXED [Facility]: COUNTD(if [Source_System]='Online' then [Id] end)}

it just counts the number of distinct ids for each facility where the user purchased online. I then take this measure and add it to the filters card and set it to 'where > 10'. This way I can filter out any facility that has less than 10 online orders

 

In PowerBI: I thought I got the calculation right; 

Test2 = CALCULATE(DISTINCTCOUNT(Query1[Id]),Query1[Source_System] = "Online",ALLEXCEPT(Query1,Query1[Facility]))
I then put the measure in as a filter and set it to > 10 and it doesn't do anything. Does anyone have any ideas?
 
Some stuff between the 2 programs translates super easily and some makes me want to pound my head against the wall.
Any help is much appreciated!
Thanks,
Micah
1 ACCEPTED SOLUTION
Jimmy801
Community Champion
Community Champion

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

View solution in original post

5 REPLIES 5
JarroVGIT
Resident Rockstar
Resident Rockstar

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:

image.png

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):

image.png

 

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! 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not 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

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! 🙂





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Jimmy801
Community Champion
Community Champion

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

Anonymous
Not applicable

Thank you Jimmy! this worked and glad to know I was at least on the right track.

 

I really appreciate your help with this!

 

-Micah

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.