Forum Discussion
Summarize filtered table
Hi, I have a table Like the following
| App Id | Date | Location | Count |
| 1 | 2020-1-1 | USA | 2 |
| 1 | 2020-1-2 | USA | 3 |
| 2 | 2020-1-1 | China | 5 |
| 2 | 2020-1-3 | China | 10 |
| 3 | 2020-1-2 | USA | 4 |
I created a summarized table using the following DAX Expression
SummarizedTable = SUMMARIZE(Table, Table[App Id], "CountSummarized", SUM(Table[Count]))
I also created a graph that renders a histogram of the number of app Ids per each count bucket. I do not know if it is possible or no but I want to add the Date and Location columns above as filters but not summarization dimensions. in other words I want the data that gets fed to the summarization DAX expression to change based on filters (slicers) on Location and Date. any idea how I can do that?
Thanks a lot in advance
Hi,
Create a Table visual and drag App Id there. Write this measure
Measure = SUM(Data[Count])
Hope this helps.
The simple aggregation will do that. No need to use summarize. Other thing you should do is create a Date Calendar dimension and join it with your tables. You can also have dimensions for USA and ID as per need. Try to have a star schema
Refer : https://docs.microsoft.com/en-us/power-bi/guidance/
you can simply use sum in Visual or create a measure
Counts = sum(Table[Count])
I am hosting a webinar on 25th April on Power BI, Check Details - https://www.linkedin.com/posts/amitchandak78_webinar-tech-techforgood-activity-6658266754378231808-ye5L
5 Replies
- Ashish_MathurSuper User
Hi,
Please explain the business context and for the data that you shared in the original post, please show the expected result.
- myonaizMicrosoft Employee
I am sorry I do not understand what you mean by the bussiness context.
but for the table I shared here is the expected result:
original table for reference:
App Id Date Location Count 1 2020-1-1 USA 2 1 2020-1-2 USA 3 2 2020-1-1 China 5 2 2020-1-3 China 10 3 2020-1-2 USA 4 No filters applied the data should be: (just summarizing all rows by app id and summing the count)
App Id Count 1 5 2 15 3 4 with the user for example choosing USA: (just summarizing all rows in location USA)
App Id Count 1 5 3 4 with the user for example choosing date 2020-1-1: (just summarizing all rows that happened on 2020-1-1)
App Id Count 1 2 2 5 - Ashish_MathurSuper User
Hi,
Create a Table visual and drag App Id there. Write this measure
Measure = SUM(Data[Count])
Hope this helps.