Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Say I have Query1, which looks like this:
date, origin, type, cnt 5/1/2019, A, A, 6 4/29/2019, B, A, 6 4/29/2019, C, B, 3
And I have three filters on the report where users can define a date range, what origins, and types to consider.
Now I need to create a second table (DailyFiltered) that looks like this when no filters are applied:
date, filteredCnt 5/1/2019, 6 4/29/2019, 9
While considering what the user defines in the report filters. For example, if the user were to select only type A, then Daily Filtered would instead look like this:
date, filteredCnt 5/1/2019, 6 4/29/2019, 6
Currently, I have:
Daily Filtered = summarize(keepfilters(Query1), Query1[date], "filteredCnt", sum(Query1[cnt]))
And I have Query1 and Daily Filtered joined on date, many to one, cross filter direction = Both.
The second table is only being filtered by the date filter for Query1. Not sure where I went wrong.
Hi,
Just drag Date to your visual and then use this measure
=SUM(Data[Cnt])
Hope this helps.
So then follow up question: if I wanted to get the 90th percentile of that measure, how would I do that?
@danb27 wrote:So then follow up question: if I wanted to get the 90th percentile of that measure, how would I do that?
With something like the following using the Percentilex.inc function:
90th Percentile = PERCENTILEX.INC( Values( Query1[date] ), CALCULATE(SUM(Query1[cnt])), 0.9 )
The approach of creating a new calculated table will not work. Calculated tables are evaluated when the data is refreshed, they are not re-calculated any time a filter is changed.
But you don't need a separate table for this, you could just create a measure to do the daily totals.
eg.
Daily Cnt = CALCULATE( SUM( Query1[Cnt] ), ALL( Query1 ), VALUES( Query1[date] ) )
When I try to plot this in a histogram it doesn't work. I am hoping to have a histogram where the X axis is ranges of the sum of all counts and the y axis is the number of dates that fall into each range. Thank you for all the help so far
@danb27 wrote:When I try to plot this in a histogram it doesn't work. I am hoping to have a histogram where the X axis is ranges of the sum of all counts and the y axis is the number of dates that fall into each range. Thank you for all the help so far
That's a completely new requirement. You need to generate a column for the "ranges of sums" to put on the x-axis and create a new measure that counts the dates. I answered a similar question a few weeks ago here https://community.powerbi.com/t5/Desktop/Double-grouping/td-p/672757 you should be able to use the same technique here.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
65 | |
63 | |
52 | |
37 | |
36 |
User | Count |
---|---|
79 | |
67 | |
60 | |
45 | |
45 |