Forum Discussion
countif a comparative condition is met
- 6 years ago
Add these two columns in table 1
visitaReales= countx(filter(table2,table1[vendedor]=table2[vendedor]),table2[ClienteCod]) VisitaMax=if(table1[meta]<=table1[visitaReales],table1[meta],table1[visitaReales])Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin - Anonymous6 years ago
Hi Anonymous,
According to the information in your case, I just create one sample PBIX file. You can create one measure just like in sample file:
- Get the current customer
- Calculate numbers of current customer visit
- If the number of user visits is greater than the goal number , it is counted as the goal number. Otherwise it is counted as the actual number of visits. Divide the number of final visits by the goal number to calculate the percentage of visits
maxVisit = VAR c =
MAX ( 'Visits'[Customer] )
VAR s =
COUNTAX ( 'Visits', 'Visits'[Customer] = c )
VAR vgoal =
CALCULATE (
MAX ( 'VisitGoal'[Goals] ),
FILTER ( 'VisitGoal', 'VisitGoal'[Customer] = c )
)
RETURN
DIVIDE( IF ( s < vgoal, s, vgoal ),vgoal)
Best Regards
Rena
Hi Anonymous,
According to the information in your case, I just create one sample PBIX file. You can create one measure just like in sample file:
- Get the current customer
- Calculate numbers of current customer visit
- If the number of user visits is greater than the goal number , it is counted as the goal number. Otherwise it is counted as the actual number of visits. Divide the number of final visits by the goal number to calculate the percentage of visits
maxVisit = VAR c =
MAX ( 'Visits'[Customer] )
VAR s =
COUNTAX ( 'Visits', 'Visits'[Customer] = c )
VAR vgoal =
CALCULATE (
MAX ( 'VisitGoal'[Goals] ),
FILTER ( 'VisitGoal', 'VisitGoal'[Customer] = c )
)
RETURN
DIVIDE( IF ( s < vgoal, s, vgoal ),vgoal)
Best Regards
Rena