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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
hvshalihotri
Frequent Visitor

KPI value for multi-select months in slicer

Hi Everyone,

I wanted to visualize current month data with respect to last month to compare the performance of a metric and I am using KPI card for that. This is working fine when I am using current month and previous month (target). But when in slicer I am selecting multi-select (Ctrl + Click), it is displaying only the latest updated data and not the sum of all months.

For ex - For June 2023, the value is 100 and for May 2023 it is 50. When clicking both the months it should display 150 as answer but it is giving me 100 (the latest one which is selected/clicked in slicer).

 

Is there any way I can solve this problem?

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

Hi  @hvshalihotri ,

 

You can try the following dax:

Measure =
var _selectyear=SELECTEDVALUE('Table'[Date].[Year])
var _selectmonth=SELECTCOLUMNS('Table',"1",'Table'[Date].[Month])
return
SUMX(
    FILTER(ALL('Table'),
    YEAR('Table'[Date])=_selectyear&&'Table'[Date].[Month] in _selectmonth),[Value])

 

 

Best Regards,

Liu Yang

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
v-yangliu-msft
Community Support
Community Support

Hi  @hvshalihotri ,

 

You can try the following dax:

Measure =
var _selectyear=SELECTEDVALUE('Table'[Date].[Year])
var _selectmonth=SELECTCOLUMNS('Table',"1",'Table'[Date].[Month])
return
SUMX(
    FILTER(ALL('Table'),
    YEAR('Table'[Date])=_selectyear&&'Table'[Date].[Month] in _selectmonth),[Value])

 

 

Best Regards,

Liu Yang

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

lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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