cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ashu710
Frequent Visitor

Duplicates using Date and Duplicate/Original Slicer

Hi all, I would like to implement two slicers on a table similar to the one below. One for date and the other one for duplicates. For example, if the Duplicate/Original slicer says "Original" and Date Slicer says "01-01-2022" to "07-01-2022" the visual should show "3" and if the Duplicate/Original says "Duplicate" in the same date range, the visual should show 4. Thanks.

ashu710_0-1642518776909.png

 

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

Hi, @ashu710 

Try this:

result =
VAR _originalValues =
    DISTINCTCOUNT( yourTable[valuesColumn] )
VAR _duplicateValues =
    COUNT( yourTable[valuesColumn] ) - _originalValues
VAR _if =
    SWITCH(
        TRUE(),
        SELECTEDVALUE( 'theTable'[Slicer] ) = "Original", _originalValues,
        SELECTEDVALUE( 'theTable'[Slicer] ) = "Duplicate", _duplicateValues
    )
RETURN
    _if

 

 

Best Regards,
Community Support Team _ Zeon Zheng

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-angzheng-msft
Community Support
Community Support

Hi, @ashu710 

Try this:

result =
VAR _originalValues =
    DISTINCTCOUNT( yourTable[valuesColumn] )
VAR _duplicateValues =
    COUNT( yourTable[valuesColumn] ) - _originalValues
VAR _if =
    SWITCH(
        TRUE(),
        SELECTEDVALUE( 'theTable'[Slicer] ) = "Original", _originalValues,
        SELECTEDVALUE( 'theTable'[Slicer] ) = "Duplicate", _duplicateValues
    )
RETURN
    _if

 

 

Best Regards,
Community Support Team _ Zeon Zheng

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

BA_Pete
Super User
Super User

 

Wow, didn't fancy waiting a few hours for your answer on the other thread, huh?

I'll close off the old thread as you now have this one open as well.

 

FWIW, I'd be interested to know why you need to add this amount of complexity into your reporting when 99% of the time just displaying the two measures I gave you in the other thread would more than suffice.

 

Pete

ashu710
Frequent Visitor

Hi @BA_Pete there's reporting that needs to be done on an urgent basis. I had already presented the solution you sent to my manager, and he thought that this would be an ideal solution. A few more calculations would be based off those measures, which I am unable to present using the given solution. Thanks.

 

Ashu

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors