Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I need to calculate how many stores there are in total only if there are any units. I need to do it in a measure.
The stores with a value is 28 and the count all measure shows 35
Solved! Go to Solution.
Hi, @krzysztof
Based on your description, I created data to reproduce your scenario.
You may create a measure as follows.
Count All =
COUNTROWS(
FILTER(
ALL('DWH Dimlocalization'),
'DWH Dimlocalization'[StoreID]<>BLANK()&&
'DWH Dimlocalization'[Units]<>BLANK()
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @krzysztof
Based on your description, I created data to reproduce your scenario.
You may create a measure as follows.
Count All =
COUNTROWS(
FILTER(
ALL('DWH Dimlocalization'),
'DWH Dimlocalization'[StoreID]<>BLANK()&&
'DWH Dimlocalization'[Units]<>BLANK()
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Try
sumx(summarize((Table),Table[Store],"_sum",sum(table[unit])),If([_sum]>0,1,0))
//OR
sumx(summarize(all(Table),Table[Store],"_sum",sum(table[unit])),If([_sum]>0,1,0))
Appreciate your Kudos.
@amitchandak @Mariusz @Anonymous Unfortunately, your proposals do not work. Below in the picture I present what I mean
So, you're asking for a calculated column, not a measure, right?
Hi @krzysztof
Try this
Measure =
CALCULATE(
DISTINCTCOUNT( 'DWH DimLocalization'[StoreID] );
'DWH DimLocalization'[units] <> BLANK()
)
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
90 | |
87 | |
84 | |
66 | |
49 |
User | Count |
---|---|
131 | |
110 | |
96 | |
70 | |
67 |