Forum Discussion
Categorising and Counting Within a Dynamic Time Period
- Anonymous1 year ago
Hi Anonymous,
Thanks for reaching out to the Microsoft fabric community forum.
I've replicated the DAX measures on my end and generated the desired output. I've uploaded the .pbix file please take a look and let me know if it aligns with your requirements.Additionally, the third DAX measure returns a division result, which does not represent the percentage value. To display it correctly as a percentage, go to the visual's formatting options, navigate to Data format, and change the format from General to Percentage. This will ensure the value is presented with the % symbol for better readability.
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thanks and Regards
Anonymous Create a measure to count the total number of missing episodes:
DAX
TotalMissingEpisodes =
CALCULATE(
COUNTROWS('Table'),
'Table'[Form Name] = "Missing Episode"
)
Create a measure to count the number of repeat missing episodes:
DAX
RepeatMissingEpisodes =
CALCULATE(
COUNTROWS('Table'),
'Table'[Form Name] = "Missing Episode",
FILTER(
'Table',
CALCULATE(
COUNTROWS('Table'),
'Table'[Person ID] = EARLIER('Table'[Person ID]),
'Table'[Form Name] = "Missing Episode"
) > 1
)
)
Create a measure to calculate the percentage of repeat missing episodes:
DAX
PercentageRepeatMissingEpisodes =
DIVIDE(
[RepeatMissingEpisodes],
[TotalMissingEpisodes],
0
)
Ensure your date slicer is connected to the date table and the main table.
Add a card visual to display the PercentageRepeatMissingEpisodes measure.
Add a slicer visual to allow users to select the date range.