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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

How to display dynamic value in the card according to months and year buttons using DAX formula

Hi, I need help as I am still new to PowerBI. 

 

Basically, I am creating Card that displays dynamic numbers that will reflect according to the year or month that I select. It is quite similar to this dashboard here. When you click on the year 2019 and month like December, the values under Key Training Metrics section will change accordingly. 

 

zxavierdeloitte_0-1600418542825.png

 

So, in my case, I am using DAX formula

Total no of attendees = COUNT('Attendee Profile'[Email Address]) and it will only show me the total no of attendees. Whenever I click on particular year or month, the value will not change accordingly. I know that I may short of one or more functions to complete the whole formula like filter, calculate, countx, ... I don't know what will be the next formula I should consider. 

 

Appreciate the help from anyone of you. 

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario.The pbix file is attached in the end.

Table:

h1.png

 

Calendar(a calculated table):

Calendar = CALENDARAUTO()

 

There is a relationship between two tables. You may create a measure as below.

DistinctCount ID = 
CALCULATE(
    DISTINCTCOUNT('Table'[ID]),
    ALLSELECTED('Table')
)

 

Result:

h3.pngh4.png

 

Best Regards

Allan

 

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

5 REPLIES 5
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario.The pbix file is attached in the end.

Table:

h1.png

 

Calendar(a calculated table):

Calendar = CALENDARAUTO()

 

There is a relationship between two tables. You may create a measure as below.

DistinctCount ID = 
CALCULATE(
    DISTINCTCOUNT('Table'[ID]),
    ALLSELECTED('Table')
)

 

Result:

h3.pngh4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@Anonymous ,  The information you have provided is not making the problem clear to me. Can you please explain with an example.

If your table might have a date (Month /year) or it joined with Date Table that has month, year etc. It should filter. If the slicer is coming from a date in the table or date joined with the tables.


Appreciate your Kudos.


Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks for your prompt response. 

My problem is how to display the value dynamically in the "Card" feature according to the year and month selected. 

 

If you look at the example below, you can see "470 Total Invited" displayed based on Year selected for 2018 and Month selected for Jan.

 

My question is how I can dynamically reflect the value based on the Year and Month selected. If I select Year 2017 and month December, the value in the Card will change accordingly. 

 

Do I make my problem description clear to you?

zxavierdeloitte_0-1600419213655.png

 

@Anonymous ,

"If I select Year 2017 and month December, the value in the Card will change accordingly."

It should if the Date is connected.

If this happening if yes, What is the problem.

 

If not. Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

The problem is how to write the correct formula that allows me to connect with the date.

 

I wrote just a simple liner: 

Total no of attendees = COUNT('Attendee Profile'[Email Address])
 
But I need more than this line and I need help from you to advise on how to write the formula that allows me to connect with the date (Year and Month)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors