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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
jostnachs
Helper IV
Helper IV

Slicer issue

Hi All.... I have a requirement i am struggling with...

 

I have logic as below as a slicer to divide my activities. 

jostnachs_0-1739761348316.png

 

But the problem is if the activity followupstartdate is 5th feb and today is 16th feb, and if the closed status is not equal to s or u it has to fall under 2 categories.(Open & Due now ,Open & 7+days past due). but as per below screen shot t falls under due now. how do i acheive it? i.e when i select any option between these two below i should be able to see that activity.

jostnachs_2-1739761489477.png

 

jostnachs_1-1739761426606.png

 

Help please!

4 REPLIES 4
v-heq-msft
Community Support
Community Support

Hi @jostnachs ,
You can try the following code

 

DueStatus = 
VAR TodayDate = TODAY()
VAR ClosedDate = V_DimActivities[FollowupStartDate]
VAR ClosedStatus = V_DimActivities[ClosedStatus]
VAR DaysDifference = DATEDIFF(ClosedDate,TodayDate,DAY)
RETURN
IF(
    ClosedStatus <> BLANK() && (ClosedStatus = "S" || ClosedStatus = "U"),
    "Closed",
    IF(
        ClosedStatus <> BLANK() && ClosedStatus <> "S" && ClosedStatus <> "U",
        IF(
            DaysDifference > 7,
            "Open & 7+days past due" ,
            IF(
                DaysDifference >= 0,
                "Open & Due now"
            )
        )
    )
)

 

Turn on multi-select in slicer settings

vheqmsft_0-1739866694574.png
Final output

vheqmsft_2-1739867131217.png

 

vheqmsft_1-1739867119819.png

Best regards,
Albert He


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

 

 

 

(Virus scan in progress ...)
Wilson_
Super User
Super User

jostnachs,

 

I'm guessing your logic is a calculated column? In any case, one DAX calculation can't return two different values. My first question is why would your slicer criteria not be mutually exclusive? Why would one item fall under multiple statuses?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





What do you mean by mutually exclusive... sorry i dont get it.

jostnachs,

 

Why would your slicer criteria not be mutually exclusive, meaning I would suggest having slicer options (ex: A, B, and C) where one activity must be either A, B, or C and cannot be more than one of A, B, and C at the same time.

 

Let me know if I should explain further or differently!


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

 

P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements