Forum Discussion
IF
5 years agoPost Prodigy
filter from different column
Hi,
I use the "Slicer" column for a slicer to select. I also use the month column as a slicer. I try to write a measure that should give me the following result: If nothing is selected in the slicer filter, I want to show the value for type=V for the selected month. If a value from the "slicer" column is selected, it should bring the relevant value. I don't want to use a second slicer for the "type" column. I wrote this but it does not work as I expected.
Can you help me? Thanks in advance!
| Month | Type | Slicer | Value |
| 06.2021 | # | A | 4 |
| 06.2021 | # | B | 5 |
| 06.2021 | # | C | 6 |
| 06.2021 | # | X | 8 |
| 06.2021 | V | X | 9 |
| 07.2021 | # | A | 14 |
| 07.2021 | # | B | 15 |
| 07.2021 | # | C | 16 |
| 07.2021 | # | X | 18 |
| 07.2021 | V | X | 19 |
Measure =
var a=IF(SELECTEDVALUE('Table'[Slicer])=BLANK(), "X", SELECTEDVALUE('Table'[Slicer]))
return
CALCULATE(SUM('Table'[Value]), 'Table'[Slicer]=a, 'Table'[Type]="V")
- Value total : =IF (NOT ISFILTERED ( Slicer[Slicer] ),CALCULATE ( SUM ( Data[Value] ), KEEPFILTERS ( Types[Type] = "V" ) ),SUM ( Data[Value] ))
1 Reply
- Jihwan_KimSuper UserValue total : =IF (NOT ISFILTERED ( Slicer[Slicer] ),CALCULATE ( SUM ( Data[Value] ), KEEPFILTERS ( Types[Type] = "V" ) ),SUM ( Data[Value] ))