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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sahubibhuti45
Frequent Visitor

Two date slicer for two kpi card of same column.

I have a calender table and a main table.

 

I want two kpi cards of one holding "outstanding amount" with a date slicer and where as in other kpi card having same "Outstanding amount" but a different date slicer , after that i want to calculate the difference between the two values of the kpi cards.

 

Is it possible?

 

 

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

Hi @sahubibhuti45 

 

If you don't want to copy the calender table.

Maybe you can try this:

First of all, I create a set of sample data:

vzhengdxumsft_0-1708409284160.pngvzhengdxumsft_1-1708409295384.png

Then create a measure:

MEASURE = 
VAR _maxdata =
    MAX ( 'date'[date] )
VAR _mindata =
    MIN ( 'date'[date] )
RETURN
    CALCULATE ( SELECTEDVALUE ( sales[sales] ), 'date'[date] = _maxdata )
        - CALCULATE ( SELECTEDVALUE ( sales[sales] ), 'date'[date] = _mindata )

Then create a slicer with the style of between:

vzhengdxumsft_2-1708409489483.png

Then you can choose two value(max and min) with the slicer.

The result is as follow:

vzhengdxumsft_3-1708409682517.png

Best Regards

Zhengdong Xu
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

3 REPLIES 3
v-zhengdxu-msft
Community Support
Community Support

Hi @sahubibhuti45 

 

If you don't want to copy the calender table.

Maybe you can try this:

First of all, I create a set of sample data:

vzhengdxumsft_0-1708409284160.pngvzhengdxumsft_1-1708409295384.png

Then create a measure:

MEASURE = 
VAR _maxdata =
    MAX ( 'date'[date] )
VAR _mindata =
    MIN ( 'date'[date] )
RETURN
    CALCULATE ( SELECTEDVALUE ( sales[sales] ), 'date'[date] = _maxdata )
        - CALCULATE ( SELECTEDVALUE ( sales[sales] ), 'date'[date] = _mindata )

Then create a slicer with the style of between:

vzhengdxumsft_2-1708409489483.png

Then you can choose two value(max and min) with the slicer.

The result is as follow:

vzhengdxumsft_3-1708409682517.png

Best Regards

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

dsptchr68
Frequent Visitor

Create a copy of the calendar table, duplicate the relationship between tables and use the copy for the second slicer. 

Thanks, I have tried creating two different tables and tried this and was able to get the solution.

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.