cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mairiau
Regular Visitor

Dax formula: use a field as a filter

Hi everyone,

I'm having some issues with Dax formula.

 

Conext:

In my reports, i use 3 files:

- A data base

- one with raw data "Rapport Pepperi"

- another one with a list of account ID and dates of visits that I use as a "carbon copy". = I select the data that will be display in my report. => "visited stores 2019"

 

The "carbon copy" and the raw data files are both link with the data base with the account ID field.

 

I use the following column formula, to be able to use it in a filter.

"visited stores = Contains('visited stores 2019'; 'Visited stores 2019'[Account ID];'Rapport Pepperi'[Account ID]"

 

The probleme is :

I want to had a date relative filter because i want a number to appear only 2 time in the "carbon copy" file while the same number can appears 4 times in the raw data. These 2 times will be related to a date and need to appear in the report.

 

The date relative fields are 'visited stores 2019'[visit date] and 'Rapport Pepperi'[visit date]

 

To sum up

In word I need a column in "rapport pepperi" file saying  visited IF Account ID is in both files "rapport pepperi" and "visited stores 2019" && 'visited stores 2019'[visit date] and 'Rapport Pepperi'[visit date] are matching =0;1 or True;False

 

 

Thanks in advance, I hope i am clean in my explanantion.

 

Mathieu

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Dax formula: use a field as a filter

Hi @mairiau ,

 

I think you're referring romoving the duplicate rows, power query could do the trick.

03.PNG

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

6 REPLIES 6
Super User IV
Super User IV

Re: Dax formula: use a field as a filter

@mairiau hey sorry not very clear from you post what you are looking for. Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490






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

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





mairiau
Regular Visitor

Re: Dax formula: use a field as a filter

Hi Parry,

Am I clearer ?

Super User IV
Super User IV

Re: Dax formula: use a field as a filter

@mairiau can you share sample data and expected output. 






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

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





mairiau
Regular Visitor

Re: Dax formula: use a field as a filter

 

I created some examples because in Power Bi this will be unclearer.

 

You can see on the table "Rapport Pepperi" the account ID 15 and 43 appears 2 times but in my table "Visited stores 2019" the visits of Januray were not selected.

 

With my fomula "CONTAINS('Visited stores 2019';'Visited stores 2019'[ID];'Rapports Pepperi'[Account ID])" they will appear because there is no allusion to the date. While i want to see only the visits in the table visited stores 2019. 

 

power bi 1.PNGpower bi 2.PNG

Community Support
Community Support

Re: Dax formula: use a field as a filter

Hi @mairiau ,

 

I think you're referring romoving the duplicate rows, power query could do the trick.

03.PNG

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

Community Support
Community Support

Re: Dax formula: use a field as a filter

Hi @mairiau 

 

Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution. if not, please share more details about your question, we'd like to provide further support. thanks!
If you've fixed by your own, it would be much appreciated if you can share your solution here. 

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors