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.
Hi All,
I have a table like below
I need to count the number of app ids which fall in each month (e.g. how many app ids are there in oct 2023, how many in nov 2023 and so on).
After that I need to display it on a stacked bar chart with functional group as legend. months as x axis and count of app ids as y axis.
Any help would be appreciated.
Thanks
Solved! Go to Solution.
Based on your description, I make the new DAX expression, you may check the result below:
App Count = var _selyear=SELECTEDVALUE('DateTable'[Date].[Year]) var _selmonth=SELECTEDVALUE('DateTable'[Date].[MonthNo]) var _date1= EOMONTH(date(_selyear,_selmonth,1),0) var _date2= date(_selyear,_selmonth,1) return COUNTROWS( FILTER( 'Table', 'Table'[Start Date] <=_date1 && 'Table'[End Date] >= _date2 ) )
Hope it helps.
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Based on your description, I make the new DAX expression, you may check the result below:
App Count = var _selyear=SELECTEDVALUE('DateTable'[Date].[Year]) var _selmonth=SELECTEDVALUE('DateTable'[Date].[MonthNo]) var _date1= EOMONTH(date(_selyear,_selmonth,1),0) var _date2= date(_selyear,_selmonth,1) return COUNTROWS( FILTER( 'Table', 'Table'[Start Date] <=_date1 && 'Table'[End Date] >= _date2 ) )
Hope it helps.
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply. Here it is:
Functional Group | App Id | Start Date | End Date |
FG01 | App01 | 19-06-2023 | 27-06-2023 |
FG02 | App02 | 19-06-2023 | 27-06-2023 |
FG03 | App03 | 08-06-2023 | 29-06-2023 |
FG01 | App04 | 23-05-2023 | 31-08-2023 |
FG02 | App05 | 16-11-2023 | 13-12-2023 |
FG03 | App06 | 01-11-2023 | 01-12-2023 |
FG01 | App07 | 22-02-2024 | 20-03-2024 |
FG02 | App08 | 22-02-2024 | 20-03-2024 |
FG03 | App09 | 26-07-2024 | 05-09-2024 |
FG01 | App10 | 22-11-2024 | 19-12-2024 |
FG02 | App11 | 22-04-2024 | 15-06-2024 |
FG03 | App12 | 20-02-2025 | 19-03-2025 |
@Vaibhav3008 Hi!
you need to create two measures, you can find the solution in the attached pbix
If I answered correctly, accept my answer as a solution, otherwise direct the problem to me and we will solve it!
BBF
Thanks for the all the help on this.
Currently the count is only taking start date into account. I need the count of apps falling in between start and end dates. Example - App11 should be counted in April 2024, May 2024 and June 2024 because the start and end dates are like that. Another example - App05 should be counted in November 2024 and December 2024.
Thanks for the reply.
I am actually doing the same thing which you did here. But somehow it's not working.
As you can see in the pic below. The count for June 2023 should be atleast 4 (App01, App02, App03 and App04 all are falling inside June 2023). But the count in graph is coming as 1 only for June 2023.
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 |
---|---|
11 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
14 | |
12 | |
11 | |
10 | |
9 |