Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi folks,
I'd like to calculate how many stores that sells 0 item in between start date and the latest day base on a table name "store" and its data structure below
Expected Result : 2 stores (C and D)
My attempted calculation is
noVolumnStore = VAR startDate = DATE(2018,07,01) VAR latestDate = MAX( store[Datekey] ) VAR changeVolumn = CALCULATE( SUM(Cumulative_sold_item), store[Datekey] = latestDate ) - CALCULATE( SUM(Cumulative_sold_item), store[Datekey] = startDate) RETURN CALCULATE( DISTINCTCOUNT( store[Store]), changeVolumn = 0)
Thank you in advance
Solved! Go to Solution.
CALCULATE( SUM(Cumulative_sold_item), store[Datekey] = latestDate )
In the above snippet, you need to compare the store as well. so you may need to add this conditon as well.
Store[StoreID] = Earlier ( Store[StoreID])
So it would be ...
CALCULATE( SUM(Cumulative_sold_item), store[Datekey] = latestDate,Store[StoreID] = Earlier ( Store[StoreID]) )
Thanks
Raj
Hi @ohojames,
Have you resolved your issue according to the solution @Anonymous posted? If it is, please mark the reply as answer, and more people will benefit from here.
Best Regards,
Angelia
CALCULATE( SUM(Cumulative_sold_item), store[Datekey] = latestDate )
In the above snippet, you need to compare the store as well. so you may need to add this conditon as well.
Store[StoreID] = Earlier ( Store[StoreID])
So it would be ...
CALCULATE( SUM(Cumulative_sold_item), store[Datekey] = latestDate,Store[StoreID] = Earlier ( Store[StoreID]) )
Thanks
Raj
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |