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.
Dear all,
I'm trying to create a measure to show the number of accounts that have the following attributes:
- Status: active
- Relationship Type: Customer, (blank), Non Buying Entity
I used this measure but I get an error.
Solved! Go to Solution.
FILTER can handle multiple conditions as long as they are on the same table, you just need to join them with && for and and || for or conditions.
If you are using them inside a CALCULATE statement then you don't need to explicitly specify FILTER, you can pass in as many filter conditions as you like and they can be across multiple tables.
For the relative date filter, if you have a proper date table set up you could use something like
Within last 3 months =
VAR StartDate =
EOMONTH ( TODAY (), -4 ) + 1
RETURN
CALCULATE ( [My measure], DATESBETWEEN ( 'Date'[Date], StartDate, TODAY () ) )
Try
_Measure Customer Accounts =
CALCULATE (
COUNTROWS ( Account ),
Account[Status] = "Active",
Account[Relationship Type] IN { "Customer", BLANK (), "Non buying entity" }
)
Perfect, that works! Thanks a lot for the fast response! 🙂
Would you have some advice on the other questions I added later, too? ->
FILTER can handle multiple conditions as long as they are on the same table, you just need to join them with && for and and || for or conditions.
If you are using them inside a CALCULATE statement then you don't need to explicitly specify FILTER, you can pass in as many filter conditions as you like and they can be across multiple tables.
For the relative date filter, if you have a proper date table set up you could use something like
Within last 3 months =
VAR StartDate =
EOMONTH ( TODAY (), -4 ) + 1
RETURN
CALCULATE ( [My measure], DATESBETWEEN ( 'Date'[Date], StartDate, TODAY () ) )
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 |
---|---|
105 | |
105 | |
88 | |
73 | |
66 |
User | Count |
---|---|
124 | |
113 | |
98 | |
81 | |
72 |