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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Table that shows data only for last month (unless the user want otherwise)

Hello,

 

I have 2 tables:
1) Table with a list of roles and employee number attached to them.

TomaszB_1-1613566941145.png 

2) Chart with dates 

  TomaszB_2-1613566998528.png

Every person is attached to a different date (they are taken from excel- there is a difference between specific days but it is not the case) 

TomaszB_4-1613567143834.png

TomaszB_3-1613567120883.png

 

Difficulty is:
I want this first graph to show on a default nr of employee only for the actual month (March in this case)

TomaszB_5-1613567303341.png

But it is summing up all the employees for all the months, unless I click particular month. 

 

I was thinking about adding to this visual a filter with date, but then interaction with the date graph no longer works.

 

Do you have any idea how to do it?

 

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

please try to create a measure

Measure = 
VAR maxdate=max('Table'[Date])
return CALCULATE(count('Table'[First&Last]),FILTER('Table',YEAR('Table'[Date])=year(maxdate)&&MONTH('Table'[Date])=month(maxdate)))

1.PNG

Below is the attachment





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

@Anonymous 

please try to create a measure

Measure = 
VAR maxdate=max('Table'[Date])
return CALCULATE(count('Table'[First&Last]),FILTER('Table',YEAR('Table'[Date])=year(maxdate)&&MONTH('Table'[Date])=month(maxdate)))

1.PNG

Below is the attachment





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Thanks sooo much !

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Greg_Deckler
Super User
Super User

@Anonymous Well you could create a measure that returns 1 for only the most current month and 0 otherwise and filter on that. But if I understand your second question, you would want a way for users to disable this, correct? Perhaps you could use something like HASONEVALUE to check if the user has selected something in the date graph and if so, return 1. If a check confirms that nothing has been selected, then you could implement returning 1 for the current month only and 0 otherwise.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler 

Thanks for quick reply.

 

Is there no simpler way to do it?

I am not soo good at DAX

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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