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 moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
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()
)
User | Count |
---|---|
93 | |
92 | |
85 | |
83 | |
49 |
User | Count |
---|---|
150 | |
142 | |
112 | |
73 | |
55 |