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

How to get the values correct in the KPI Cards?

Hi

 

I created two measures called total leads and total leads ly (previous year)

 

Total leads = COUNTROWS('pack Unpacked')
Total Leads LY = CALCULATE([Total leads], SAMEPERIODLASTYEAR('Date'[Date]))
 
I am showing total leads and total leads ly in the KPI Chart. The values are coming correct if I select the particular year, however, when I select more than one year the values are not matching in the KPI visuals.
 
Values are correct when I show for a particular year
jason2000_0-1623801528080.png

 

Values are not matching when I select 2019 data,

 

jason2000_1-1623801565269.png

 

I need to get 20201 in the KPI visuals, previous year showing correct. How to fix it. Basically, I need to get values in the KPI card based on any date selected. Is there any way?

 

Attach my PBIX file here

https://we.tl/t-xLXY5Hgr1z

 

Please advise

 
1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @Anonymous,

 

You can try measure as:

Total leads = CALCULATE(COUNTROWS('pack'),ALLEXCEPT('Date','Date'[Date]))
Total Leads LY = 
CALCULATE([Total leads],SAMEPERIODLASTYEAR(ALLSELECTED('Date'[Date])))

 Here is the output:

vxulinmstf_0-1624002863633.png

 

If you still have some question, please don't hesitate to let me known.‌‌

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

View solution in original post

7 REPLIES 7
v-xulin-mstf
Community Support
Community Support

Hi @Anonymous,

 

You can try measure as:

Total leads = CALCULATE(COUNTROWS('pack'),ALLEXCEPT('Date','Date'[Date]))
Total Leads LY = 
CALCULATE([Total leads],SAMEPERIODLASTYEAR(ALLSELECTED('Date'[Date])))

 Here is the output:

vxulinmstf_0-1624002863633.png

 

If you still have some question, please don't hesitate to let me known.‌‌

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

Anonymous
Not applicable

@m3tr01d @Anonymous @Syndicate_Admin  Thanks for your reply. There are no visual filters on the table or KPI card. If I select the date for one year, the values are showing correctly. Not showing for multiple years

 

jason2000_0-1623808259078.png

 

Anonymous
Not applicable

Please share PowerBI file if you can

Anonymous
Not applicable

@Anonymous Thanks for your support. Please find the pbix file

 

https://we.tl/t-xLXY5Hgr1z

 

Kindly check and advise. Thanks

Syndicate_Admin
Administrator
Administrator

According to I see, the KPI is not being affected by the filter that comes from the date, have you seen that part?

Anonymous
Not applicable

Hello @Anonymous ,

 

Please check if there is any duplicates, visual filters, page level filters and compare yearwise data in a table. 

 

This is the only rootcause you can do why the sum is not coming correctly. As you have not created any measures mostly it would be the data issue.

 

Thanks,

Karthik

m3tr01d
Continued Contributor
Continued Contributor

Hello!
are you sure you don't have any visual filters on the table or on the KPI card?

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.