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.
Hello,
Kindly help to calculate month count as below. I have two slicers one for Year and one for month but it should not effect measure.
Date | Year | Month Count |
1/1/2022 | 2022 | 2 |
1/2/2022 | 2021 | 11 |
1/1/2021 | 2020 | 3 |
1/2/2021 | ||
1/3/2021 | ||
1/5/2021 | ||
1/6/2021 | ||
1/7/2021 | ||
1/8/2021 | ||
1/9/2021 | ||
1/10/2021 | ||
1/11/2021 | ||
1/12/2021 | ||
1/1/2020 | ||
2/1/2020 | ||
7/1/2020 |
Solved! Go to Solution.
Create a month Year column
month Year = date([Year])*100 + month([Date])
countx(values(Table[month Year]), [month Year] )
Hi @Chandrashekar ,
Create a measure like below:-
Measure =
CALCULATE (
COUNT ( 'Table'[Date] ),
FILTER (
'Table',
YEAR ( 'Table'[Date] ) = SELECTEDVALUE ( Date[Year] )
&& MONTH ( 'Table'[Date] ) = SELECTEDVALUE ( Date[Month No] )
)
)
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hello Samarth,
am getting wrong count. am attaching sample report. Sample Report
Measure should not consider slicer(Month No) only it should consider slicer(year).
I want count of months for selected year.
@Chandrashekar disable filtering of table with edit interaction and use formula like below:-
MonthCount =
CALCULATE(
Count('Date'[Date]),
FILTER(
'Date',
year('Date'[Date])=SELECTEDVALUE('Date'[Year])
))
Update file url below:-
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hello Samarth,
If i change month count is getting effected. even we change month values should not get effected.
use edit interaction to disable filter on card.
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hello Samarth,
Thanks,
Regards,
Chandrashekar B
Create a month Year column
month Year = date([Year])*100 + month([Date])
countx(values(Table[month Year]), [month Year] )
Hello Amit,
Sorry for wrong question. I need count in Card as below. When user selected 2020 I should output as 3.
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 |
---|---|
14 | |
11 | |
10 | |
10 | |
10 |
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
8 |