Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Measure that counts a category if the count of the category changes over time

Below is an example of the matrix that counts the category:

work22_0-1660856922349.png

 

Below is an example of the output from the measure I need:

Category2022.242022.252022.26
BCP-06001
BCP-08000
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

Create a measure like this 

Measure = 
VAR _DATE=CALCULATE(MAX('Table'[Date]),FILTER(ALLEXCEPT('Table','Table'[Category]),[Date]<MAX('Table'[Date])))
VAR _VALUE=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Category]=MAX('Table'[Category])&&[Date]=_DATE))
RETURN IF(MAX('Table'[Date])<>CALCULATE(MIN('Table'[Date]),ALLEXCEPT('Table','Table'[Category]))&& _VALUE<>SUM('Table'[Value]),1,0)

Then add the measure in Matrix visual .

Ailsamsft_0-1662605501290.png

I have attached my pbix file , you can refer to it .

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous 

Create a measure like this 

Measure = 
VAR _DATE=CALCULATE(MAX('Table'[Date]),FILTER(ALLEXCEPT('Table','Table'[Category]),[Date]<MAX('Table'[Date])))
VAR _VALUE=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),[Category]=MAX('Table'[Category])&&[Date]=_DATE))
RETURN IF(MAX('Table'[Date])<>CALCULATE(MIN('Table'[Date]),ALLEXCEPT('Table','Table'[Category]))&& _VALUE<>SUM('Table'[Value]),1,0)

Then add the measure in Matrix visual .

Ailsamsft_0-1662605501290.png

I have attached my pbix file , you can refer to it .

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

daXtreme
Solution Sage
Solution Sage

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.