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
IAA
Helper I
Helper I

Multiple slicer selections in measure

Dear Community,

I am building a cashflow forecast, where the due date of bills can dynamically changed with an X number of days, using a parameter. This is combined with a slicer where the specific cost category can be selected. The due date for that specific category can be extended when this category is selected.

I arranged this with the following formula:

 

 

Measure = 
 IF(ALLSELECTED('Slicer Table'[Category]) in FILTERS('Value by date 2'[Category]),
 CALCULATE  (SUM( 'Value by date 2'[Value] ) , DATEADD(DimDate[Date],-[Value Parameter],DAY)), 
 CALCULATE  (sum('Value by date 2'[Value]) , DATEADD(DimDate[Date],0,DAY)))

 

 

This works perfect, but the problem is that there is an error when I select multiple categories at the same time:

IAA_0-1596098730023.pngIAA_1-1596098779353.png


The error says:  a table of multiple of values was supplied where a single value was expected.

Can someone give some advice how to adjust my DAX-formula to make it possible to select multiple items?

If it helps, the PBIX file can be downloaded here:
https://www.dropbox.com/s/nfuec09wlxovioo/Casfhlow%20Forecast%20share.pbix?dl=0

Thank you very much in advance!




2 REPLIES 2
amitchandak
Super User
Super User

@IAA , Try like

Measure =
IF('Value by date 2'[Category] in ALLSELECTED('Slicer Table'[Category]),
CALCULATE (SUM( 'Value by date 2'[Value] ) , DATEADD(DimDate[Date],-[Value Parameter],DAY)),
CALCULATE (sum('Value by date 2'[Value]) , DATEADD(DimDate[Date],0,DAY)))

Thank you for your time and help @amitchandak ,

I tried your solution, however I get this error:

IAA_0-1596100948571.png


Probably there is a simple solution, but I can't find out right now. Do you know how to fix this?

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.