Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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()
)
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
110 | |
99 | |
94 | |
88 | |
70 |
User | Count |
---|---|
166 | |
133 | |
129 | |
102 | |
98 |