Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KDew2020
Frequent Visitor

summarizing data in measure with date dynamically

Hello,

 

I am working on creating measure to identify the customers who have bought products in retail or digital or both retail and digital daily, weekly or yearly dynamically.

 

below is the same data I have. I have tried to use summarize and group by function but unable to get the measure created.

 

 

datetimeSalesCustomerIDChannelProductSales
01-Oct-201001Onlineabc20
01-Oct-201001Retailxyz10
02-Oct-201002Retailabc5
03-Oct-201003Onlinexyz40
04-Oct-201003Onlineabc20
05-Oct-201004Onlinexyz10
06-Oct-201005Retailabc5
5 REPLIES 5
v-easonf-msft
Community Support
Community Support

Hi, @KDew2020 

Could you please tell me whether your problem has been solved?
If yes, you could accept the helpful answer as solution. You also could share your own solution here. For now, there is no content of description in the thread. If you still need help, please share more details to us.

Best Regards,
Community Support Team _ Eason

negi007
Community Champion
Community Champion

@KDew2020 If you do not want to complicate your data structure there is a quick fix solution for you. You create matrix visual and add the subtotal in this. Subtotal name can be changed to anything from the matrix visual settings.

 

negi007_0-1608132116128.png

 

Let me know if above solution works for you.

 

Else second solution is to create a duplicate table and then group channel values to a new channel "Both" in that channel and then combine these two tables into one so that you can have all channels and also Both channel in the same table.




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

KDew2020
Frequent Visitor

thank you for the response but I am looking for 3 customer type

1. who bought only in retail

2. who bought only in online

3. who bought in both retail and online

 

the result for daily should be like below:

datetimeSalesCustomerTypeTotal Sales
01-Oct-20Both30
02-Oct-20Retail5
03-Oct-20Online40
04-Oct-20Online20
05-Oct-20Online10
06-Oct-20Retail5

 

similar result should be for week/Month/year where datetimeSales will be replaced with week number/Month number and year.

negi007
Community Champion
Community Champion

@KDew2020 You can create below measure to view sales by channel. 

 

SaleByChannel = CALCULATE(SUM('GroupBy Sales'[Sales]),GROUPBY('GroupBy Sales','GroupBy Sales'[Channel]))
 
negi007_1-1608008278037.png

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

amitchandak
Super User
Super User

@KDew2020 , I do not saw digital as channel, But this will one or both

create a new measure

calculate(sum(Table[sales]), filter(Table, Table[channel] in {"Retail", "Digital"}))

plot it with customer

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.