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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Canopy
New Member

Problem with measure to get results depending other table

Hi everyone!

I have a couple of measures in my dashboard:

DAX 1

Num Of eRetailers =
VAR ActualRetailersCALCULATE(   DISTINCTCOUNT(data[idStore]),    ALL(Data[Date]) )
RETURN  ActualRetailers

DAX 2

Term score
VAR MaxDate = CALCULATE(Max(data[Date]))
VAR Score     CALCULATE( SUM(Data[weighted_score]) / [Num Of eRetailers],    data[Date] = MaxDate && Data[rank_type] = 1  )
VAR SearchTermSelectedCALCULATE(  DISTINCTCOUNT('SearchTerms'[idSearchTerm]),  data[Date] = MaxDate)
VAR Ratio = DIVIDE(Score, SearchTermSelected)
Return Ratio
I need to add in DAX 2 a rule because in the model I have a table with the idSearchTerm that Not Apply to a specific Retailer, the table is : Rules (idSearchTerm, idRetailer) ,
my question is, how to add this logic to my DAX 2 in the part of VAR SearchTermSelected to exclude a combination of Term and Retailer?.
For example: I have Sales for many retailers, but, the Term 4 is not sold in Retailer 5, this row is present in the Rules table (Term 4, Retailer 5), how not include this Term / Retailer combination? I just need to get the valid terms, the terms not presents in the rule table.
Sorry for my long explanation! , If more details are needed just Tell me!
Thanks Team!
 
 
1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Filters in CALCULATE() are applied as a combination ( "AND") unless you specifically use the "||"  symbol for "OR"  alternatives.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

Filters in CALCULATE() are applied as a combination ( "AND") unless you specifically use the "||"  symbol for "OR"  alternatives.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.