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 new table with below formula
Take the list of [CODE] based on 3 different conditions and finally show the distinct count of [CODE] from these 3 lists put together. A [CODE] can satisfy more than 1 condition (A [CODE] can satisfy Condition 1 & 2, but should be counted once), hence it's required to take the disctinct count of [CODE] combing the 3 conditions. How can i achieve this?
Any help on this is much appreciated. Thank you.
Solved! Go to Solution.
Hi @Anonymous ,
Try to define a temporary table in the measure.
measure =
VAR _max = MAXX(ALLSELECTED('Calendar'),'Calendar'[Date])
VAR _min = MinX(ALLSELECTED('Calendar'),'Calendar'[Date])
var cond1 = ...
var cond2 = ...
var cond3 = ...
var _union = uinon(cond1,cond2,cond3)
return
CALCULATE(DISTINCTCOUNT([date]),_union)
Best Regards,
Jay
@Anonymous , a new table can not use slicer values , you can only use slicer value in a measure and var table inside a measure.
You can vore for an idea or log a new one
Hi @amitchandak
Thank you for the response.
So you mean, i have to create a measure instead of a New Table with that formula? and use the selections inside the Var Table within that measure?
If yes, then how can i modify the below formula to fit into a measure to calculate the distinct count of [CODE]?
Hi @Anonymous ,
You can not create new table based on slicer value because it will not recognize. So the max and min value will also be the max and min of the entire table.
If you want to calculate the count of value based on the a slicer, you could refer the below formula.
measure =
VAR _max = MAXX(ALLSELECTED('Calendar'),'Calendar'[Date])
VAR _min = MinX(ALLSELECTED('Calendar'),'Calendar'[Date])
return
calculate(distinctcount('table'[code]),filter(all('table'),column1>=_min&&column2<=max))
Best Regards,
Jay
Hi @Anonymous ,
Thank you for the response. But I would like to get the count of distinct values from 3 different conditions as mentioned in my post.
Hi @Anonymous ,
Try to define a temporary table in the measure.
measure =
VAR _max = MAXX(ALLSELECTED('Calendar'),'Calendar'[Date])
VAR _min = MinX(ALLSELECTED('Calendar'),'Calendar'[Date])
var cond1 = ...
var cond2 = ...
var cond3 = ...
var _union = uinon(cond1,cond2,cond3)
return
CALCULATE(DISTINCTCOUNT([date]),_union)
Best Regards,
Jay
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!