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.
Thanks in advance for your help.
I have a measure like such. My ultimate goal is to get a count of distinct customers (cus_no) in a defined time range filtering by (Business Unit), (specific item numbers or product category) -- combined filter
Active HBU Customers TEST = CALCULATE(DISTINCTCOUNT('Sales History'[cus_no]),DATESINPERIOD('Sales History'[inv_dt],MAX('DATE TABLE'[Current Date]),-15,MONTH),'Sales History'[business_unit]="HOSP",'Sales History'[item_no]="9000-1000" || 'Sales History'[itm_prod_cat_desc]="Trans-Infant") that gives me an error of "The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression"
Things that have worked:
WORKS
Active HBU Customers TEST = CALCULATE(DISTINCTCOUNT('Sales History'[cus_no]),DATESINPERIOD('Sales History'[inv_dt],MAX('DATE TABLE'[Current Date]),-15,MONTH),'Sales History'[business_unit]="HOSP",'Sales History'[item_no]="9000-1000")
However, when I add in the "or" criteria || 'Sales History'[itm_prod_cat_desc]="Trans-Infant") I can't get this filter to work.
Does anyone have any ideas? Thanks.
Hi @cyclones11jmf,
Try to enclose the conditions with "Filter".
Active HBU Customers TEST = CALCULATE ( DISTINCTCOUNT ( 'Sales History'[cus_no] ), DATESINPERIOD ( 'Sales History'[inv_dt], MAX ( 'DATE TABLE'[Current Date] ), -15, MONTH ), FILTER ( 'Sales History', 'Sales History'[business_unit] = "HOSP" && ( 'Sales History'[item_no] = "9000-1000" || 'Sales History'[itm_prod_cat_desc] = "Trans-Infant" ) ) )
Best Regards,
Dale
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 |
---|---|
111 | |
94 | |
83 | |
66 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |