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
Delion
Helper IV
Helper IV

How to combine 3 MEASURES fitering with 2 different FILTER

Hi

Delion_0-1613659281372.png

How to combine 3 measure appear in one card which is filtering by 2 type filter

 

In Red number there is 3 type measure : Today, Last 30 Day and MTD

This 3 measure need to filtering by 2 filter :

1. Button filter : Today and Last 30 Days

2. Drop box for each MTD

This 2 type filter will affected Red number 

I used SWITCH but it doesn't work

 

A_Slicer = 
SWITCH(
[A_Selected_Measure],
1,[A_Points_Today],
2,[A_Points_Last30D]
)

 

 

Please help

 

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Delion ,

Based on your description, I have created three measures and a combined measure:

Last 30 days = 
CALCULATE (
    SUM ( 'Table'[Value] ),
    DATESINPERIOD ( 'Table'[Date], TODAY (), -30, DAY )
)

Today = 
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Date] = TODAY () )

MTD = 
CALCULATE ( SUM ( 'Table'[Value] ), DATESMTD ( 'Table'[Past month] ) )
Combined measure =
IF (
    ISFILTERED ( 'Slicer table'[Slicer] ),
    SWITCH (
        SELECTEDVALUE ( 'Slicer table'[Slicer] ),
        "Last 30 days", [Last 30 days],
        "Today", [Today]
    ),
    IF ( ISFILTERED ( 'Table'[Past month] ), [MTD], "Please selected a slicer" )
)

s1.pngs2.png

Attached a sample file in the below, hopes it could help.

 

Best Regards,
Community Support Team _ Yingjie Li
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-yingjl
Community Support
Community Support

Hi @Delion ,

Based on your description, I have created three measures and a combined measure:

Last 30 days = 
CALCULATE (
    SUM ( 'Table'[Value] ),
    DATESINPERIOD ( 'Table'[Date], TODAY (), -30, DAY )
)

Today = 
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Date] = TODAY () )

MTD = 
CALCULATE ( SUM ( 'Table'[Value] ), DATESMTD ( 'Table'[Past month] ) )
Combined measure =
IF (
    ISFILTERED ( 'Slicer table'[Slicer] ),
    SWITCH (
        SELECTEDVALUE ( 'Slicer table'[Slicer] ),
        "Last 30 days", [Last 30 days],
        "Today", [Today]
    ),
    IF ( ISFILTERED ( 'Table'[Past month] ), [MTD], "Please selected a slicer" )
)

s1.pngs2.png

Attached a sample file in the below, hopes it could help.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank @v-yingjl 

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.