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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
VK_nz
Helper I
Helper I

Month & YTD KPI % with Month Slicer selection

Hi all,

 

I am calculating KPI % with part/total sum and the % is returning correct for slicer month selection, also I can do multiple month slection to make it YTD.

 

I am trying to avoide doing multiple month selection to get YTD, was trying 

YTD% = (([apointmnt_VCare_Count_KPI]/[apointmnt_VCare_Count_KPI]),DATESYTD('Calendar'[Date].[Date],"06-30")) so the card will display YTD % as per the month selected in the slicer but it comes back with below error:
Capture.JPG 
1 ACCEPTED SOLUTION

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1732014578840.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

10 REPLIES 10
VK_nz
Helper I
Helper I

@Ashish_Mathur  Thank you, so I had to approach it differently.. I would like to connect to discuss consulting for future BI solution - best way to contact you please?

Hi,

You may send me a private message.  I will share my contact details with you there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I figured out the issue, as I only have year and month in Fact tbl so I created calculated 'Date' column with each month having 1st of the month date (01/01/2023, 01/02/2023 and so on)

Date = DATE('ContactLog'[SERVICE_ACTIVITY_YEAR],'ContactLog'[SERVICE_ACTIVITY_MONTH],1)
Capture.JPG
 
to join with Calender table 'Date'. 
Any pointer on how do I change the FactTbl date to full month date (30 or 31 day)?

Since you have only Month and year, generating the first date of the month should be just fine.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
VK_nz
Helper I
Helper I

Thanks @Ashish_Mathur 

 

I have one measure which is doing the sum to count total occurance and other Measure to count sub-set of the occurance based on filter condition.

I wanted to get the % e.g out of 100 car how many were black car, which is working fine by simple measure i created black car/total car. 

I have separate filters for fiscal year and fiscal month.. what I want is to get the YTD % when I select a month e.g my FiscalYear start at July so if I select December in my month filter then it should show me the YTD (July to Dec) %.

 

I tried your solution, while its not thrwoing any error - it simply says 'Blank' as value so something is not working.. I did try changing month selections, in the measure tried '06/30', '30-6' etc. without success.

Hi,

Thanks for the solution Ashish_Mathur  offered, and i want to offer some more inforamtion for user to refer to.

hello @VK_nz , after testing, the code can work well in my sample.

vxinruzhumsft_1-1731989332434.png

 

can you provide the code or the picture of the problem you have faced?

 

Best Regards!

Yolo Zhu

 

 

Share some data and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

I do not know what you want,  Just select a single Year and Month in the slicer.  Try this measure.

Measure = divide([apointmnt_VCare_Count_KPI],calculate([apointmnt_VCare_Count_KPI],datesytd(calendar[date],"30/6")))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

 

@Ashish_Mathur,@v-xinruzhu-msft   below table for data reference, I am countig the Virtualcontact% out of the total contact made.

FinYearFinMonthCustContactModeTotalContactMade
2023/246Other1
2024/257Other1
2023/2411Other1
2023/2412Virtual1
2023/243Other1
2023/2412Other1
2023/2412Other1
2023/2410Other1
2023/2412Other1
2023/249Other1
2024/259Other1
2024/259Other1
2024/2510Virtual1
2024/2510Virtual1
2024/2510Virtual1
2023/241Virtual1
2024/259Virtual1
2023/2412Virtual1
2023/2411Virtual1
2023/2411Virtual1
Total  20

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1732014578840.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.