Forum Discussion
Customers whitout current filtered year orders
- 7 years ago
Hi marpisa ,
To get your desired output in Power BI, please follow the steps below.
1. Create the calculated table with the formula below.
slicer = VALUES(Table2[Year])
2. Create the measure like this.
Measure = VAR curr = SELECTEDVALUE ( Table2[Customer Name] ) VAR _string = CONCATENATEX ( FILTER ( ALLSELECTED ( Table2 ), Table2[Year] = SELECTEDVALUE ( slicer[Year] ) ), Table2[Customer Name], "," ) VAR searchvalue = COUNTROWS ( FILTER ( ALLSELECTED ( Table2[Customer Name] ), SEARCH ( curr, _string, 1, -1 ) > 0 ) ) RETURN IF ( searchvalue > 0, 0, 1 )3. Drag this measure in visual level filter and set like below.
Then you could create the year slicer based on the year column in the calculated table.
More details, please refer to my attached pbix file.
Hope this can help you!:smileyhappy:
Best Regards,
Cherry
Hi marpisa ,
To get your desired output in Power BI, please follow the steps below.
1. Create the calculated table with the formula below.
slicer = VALUES(Table2[Year])
2. Create the measure like this.
Measure =
VAR curr =
SELECTEDVALUE ( Table2[Customer Name] )
VAR _string =
CONCATENATEX (
FILTER ( ALLSELECTED ( Table2 ), Table2[Year] = SELECTEDVALUE ( slicer[Year] ) ),
Table2[Customer Name],
","
)
VAR searchvalue =
COUNTROWS (
FILTER (
ALLSELECTED ( Table2[Customer Name] ),
SEARCH ( curr, _string, 1, -1 ) > 0
)
)
RETURN
IF ( searchvalue > 0, 0, 1 )
3. Drag this measure in visual level filter and set like below.
Then you could create the year slicer based on the year column in the calculated table.
More details, please refer to my attached pbix file.
Hope this can help you!:smileyhappy:
Best Regards,
Cherry