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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have a formula that runs slow, which I am looking to improve..
Is there a more efficient way to write this formula?
(I want to return 0 if the colour is not "blue" for average calculation purposes)
In addition I want to return blank on all dates larger than today, but I did not find a way to make this work for this calculation.
# Blue People =
IF(
ISBLANK(CALCULATE([# People], Product[Colour] = "Blue")) ,
0,
CALCULATE([# People], Product[Colour] = "Blue"))
Solved! Go to Solution.
try something like this
Blue people =
var BluePeeps = CALCULATE([# People],Product[Colour]="Blue")
RETURN if(MAX('Date'[Date])<TODAY(), BluePeeps,0)
Thanks!
Ended up with a mix of both suggestions:
# Blue People =
Good to hear! For a bit simpler return you can leave off the last BLANK(). If you don't include anything for the false part of the if statement, it will automatically return blank!
Thanks, work like a charm.
Ended up with a mix of both suggestions:
# Blue People =
User | Count |
---|---|
14 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
29 | |
17 | |
11 | |
7 | |
5 |