Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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])
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])
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!