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.
Hello,
I have created a calculation
Measure = CALCULATE(
DISTINCTCOUNT([Supplier Name]),
DATEDIFF(max([Creation Date]),
TODAY(),year)==1
)
with the hope that I will get the the suppliers that were created last year etc.
Unfortunately i am working on analysis services so it does pop an error :A function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
Unfortunately i can make no tables or go back to the model itself.
Any ideas?
Solved! Go to Solution.
@Anonymous , Try like
Measure = CALCULATE(
COUNTX(values(Table[Supplier Name]),table[Supplier Name]),
filter(table, DATEDIFF(max([Creation Date]),
TODAY(),year)=1
))
OR
Measure = countx(summarize(Table , Table[Supplier Name], "_1",
calculate(lDISTINCTCOUNT([Supplier Name]),
filter(table, DATEDIFF(max([Creation Date]),
TODAY(),year)=1
))),[_1])
@Anonymous , try like
Measure = CALCULATE(
DISTINCTCOUNT([Supplier Name]),
filter(table, DATEDIFF(max([Creation Date]),
TODAY(),year)=1
))
Seems like a plausible solution @amitchandak but this is what I got when I tried to use it
SO it works only when I have the field of suppliers in the view, not in the card, isn't it strange?
@Anonymous , Try like
Measure = CALCULATE(
COUNTX(values(Table[Supplier Name]),table[Supplier Name]),
filter(table, DATEDIFF(max([Creation Date]),
TODAY(),year)=1
))
OR
Measure = countx(summarize(Table , Table[Supplier Name], "_1",
calculate(lDISTINCTCOUNT([Supplier Name]),
filter(table, DATEDIFF(max([Creation Date]),
TODAY(),year)=1
))),[_1])
Thanks! I was thinking of an addition of an "or" operator something like
Measure = countx(summarize(Table , Table[Supplier Name], "_1",
calculate(lDISTINCTCOUNT([Supplier Name]),or(
filter(table, DATEDIFF(max([Creation Date]),
TODAY(),year)=1),max([Creation Date]=Blank())
))),[_1])
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 |
---|---|
115 | |
99 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |