Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
I am trying to filter in power bi desktop using 2 conditions, I have a report with Field 1 ,Field 2 and Field 3, would like to filter when Field1(table1) contains 1000 or field2 (table2) Contains 2000 or Field3 (table3) contains 3000.
I want to add filter condition ->
Appointment has field A contains 1000 -OR
Task has field B contains 2000 -OR
Phone call has field C contains 3000
Hi @PowerBITesting,
AFAIk, power bi use 'AND' logic to link filter and the nested filter in calculating function.
If you want to achieve 'OR' filters, you may need to create an unconnected table as the source of filters, then use measure expression to extract and inaction with these selections.
Finally, you can use the measure at 'visual level filter' on your visuals to achieve the 'OR' filter effects.
If you confused about these operations, please share some dummy data then we can test to coding formula on it.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Since you are trying to use columns from different tables, Merging a dupliacte copy of the tables and writing a custom column using "List.Contains" function can do the trick. This will give you a "True" or "False" bifurcation for related rows which should serve the purpose.
Example : List.Contains({1460},[CREATED_BY_ID]) Or List.Contains({"Closed"},[CASE_STATUS]) OR
List.Contains({2434},[Count_of_closed"]))
where CREATED_BY_ID, CASE_STATUS and Count_of_closed are columns belonging to originally 3 different tables which were merged together for sake of this filtering.
@PowerBITesting , Can you share sample data and sample output in table format?
I need to calculate the number of activities WRT to Account . I need to apply filter for Appointment / task / phone call activites with OR condition.
Below is matrix report.
step -1
-> I have a created a calulcated column as - Date Group = MONTH(activitypointers[createdon])&"-"&YEAR(activitypointers[createdon]) in activityPointer Table
Step -2 I have added Date Group as columns and count of Date Group as Values - which give the count of total of activities
Step - 3 - I need to filter the data which has to be a OR condition Appointment / task / phone call activites. ?
Like Appointment (Filed 1 Contains "2000") or Phone call(Filed 3 Contains "2000") Or task(Filed 2 Contains "3000")
Account Name | 01-01-2020 | 01-02-2020 | 01-03-2020 | 01-04-2020 | Count | |
Account1 | 10 | 20 | 30 | 40 | 100 | |
Account2 | 20 | 10 | 20 | 50 | 100 | |
Account3 | 30 | 10 | 30 | 40 | 130 |
@PowerBITesting , As my initial thought we need to union some ids based on these two filters and then use them in finale calculation
https://docs.microsoft.com/en-us/dax/union-function-dax
Try to create a column to use as condtion - But this is not working ( Formula is not correct)
-> Filed1 , Filed2 and Filed 3 are multiselct option sets
-> MeasureOrCheck = CALCULATE(COUNT(activitypointers[createdon]) ,OR(OR(Contains(appointments[Filed1], 100), Contains(tasks[Filed2], 200),Contains(phonecalls[Field3], 3000))
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |