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.
Hi, what measure would show in a card that there have been 7 instances where the fire service was called in the last 3 months, please?
Month | Fire Service Called |
April | Yes |
April | No |
April | Yes |
April | No |
May | No |
May | Yes |
May | Yes |
May | No |
June | No |
June | Yes |
June | Yes |
June | Yes |
Solved! Go to Solution.
Hi @RichOB
Please try this:
Here I create a measure:
MEASURE =
VAR _currentMonth =
MONTH ( TODAY () )
RETURN
COUNTROWS (
FILTER (
ALLSELECTED ( 'Table' ),
MONTH ( 'Table'[Month] ) >= _currentMonth - 2
&& [Fire Service Called ] = "Yes"
)
)
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @RichOB
Please try this:
Here I create a measure:
MEASURE =
VAR _currentMonth =
MONTH ( TODAY () )
RETURN
COUNTROWS (
FILTER (
ALLSELECTED ( 'Table' ),
MONTH ( 'Table'[Month] ) >= _currentMonth - 2
&& [Fire Service Called ] = "Yes"
)
)
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Edit the query in Power Query (Transform Data). Add a column to query that converts the Yes to 1 and No to 0. Save query and return to Power BI Desktop.
Add a measure that sums the new column - Service Called Count = SUM(<new column>)
User | Count |
---|---|
74 | |
70 | |
39 | |
30 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
48 | |
46 |