The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
25 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
27 | |
12 | |
12 | |
12 | |
6 |