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
Anonymous
Not applicable

Cannot filter measure by available table columns

I am tasked to get the count of tickets that are going to be deployed to production and also the tickets already deployed during the last release date based on today's date.

 

So to get the previous release date, I created a variable _prevgzdate and then calculated the number of tickets >= that variable to get the total count. In here I am able to get the correct count needed.

 

previous GZ date :=
var _prevgzdate = CALCULATE(MAX(BusinessExecutiveDashboard[ProdTargetDateDP]),BusinessExecutiveDashboard[ProdTargetDateDP] < UTCTODAY())
return
CALCULATE(COUNT(BusinessExecutiveDashboard[Ticketnumber]),FILTER(BusinessExecutiveDashboard,BusinessExecutiveDashboard[ProdTargetDateDP]>=_prevgzdate))
 
Correct count:
lemmagpantay_1-1681231320109.png

The problem I have now is that I need to determine these tickets specifically by getting their details based on other available columns but when for example putting the ticket number in the visual, I get all other tickets even if they are not supposed to be included in those 23 calculated by the measure. Notice that in the image below, even those that does not have a date is reflecting 1 in the measure for some reason.

lemmagpantay_2-1681231487333.png

when in fact I should only get these:

lemmagpantay_3-1681231660441.png

 

Can somebody help?

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Anonymous 

try like:

previous GZ date :=
var _prevgzdate = 
CALCULATE(
     MAX(BusinessExecutiveDashboard[ProdTargetDateDP]),
     BusinessExecutiveDashboard[ProdTargetDateDP] < UTCTODAY()
)
return
CALCULATE(
     COUNT(BusinessExecutiveDashboard[Ticketnumber]),
     FILTER(
 BusinessExecutiveDashboard,
   BusinessExecutiveDashboard[ProdTargetDateDP]>_prevgzdate   //remove "="
    )
)
 
or 
 
previous GZ date :=
var _prevgzdate = 
CALCULATE(
     MAX(BusinessExecutiveDashboard[ProdTargetDateDP]),
     BusinessExecutiveDashboard[ProdTargetDateDP] < UTCTODAY()
)
return
CALCULATE(
     COUNT(BusinessExecutiveDashboard[Ticketnumber]),
     FILTER(
 BusinessExecutiveDashboard,
   BusinessExecutiveDashboard[ProdTargetDateDP]>=_prevgzdate
    &&NOT ISBLANK(_prevgzdate)
    )
)

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

hi @Anonymous 

try like:

previous GZ date :=
var _prevgzdate = 
CALCULATE(
     MAX(BusinessExecutiveDashboard[ProdTargetDateDP]),
     BusinessExecutiveDashboard[ProdTargetDateDP] < UTCTODAY()
)
return
CALCULATE(
     COUNT(BusinessExecutiveDashboard[Ticketnumber]),
     FILTER(
 BusinessExecutiveDashboard,
   BusinessExecutiveDashboard[ProdTargetDateDP]>_prevgzdate   //remove "="
    )
)
 
or 
 
previous GZ date :=
var _prevgzdate = 
CALCULATE(
     MAX(BusinessExecutiveDashboard[ProdTargetDateDP]),
     BusinessExecutiveDashboard[ProdTargetDateDP] < UTCTODAY()
)
return
CALCULATE(
     COUNT(BusinessExecutiveDashboard[Ticketnumber]),
     FILTER(
 BusinessExecutiveDashboard,
   BusinessExecutiveDashboard[ProdTargetDateDP]>=_prevgzdate
    &&NOT ISBLANK(_prevgzdate)
    )
)
Wilson_
Super User
Super User

Hello,

 

What happens if you filter out all blank ProdTargetDateDP values from the filter pane? Does that solve your issue?


----------------------------------
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?)




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

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.