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
MigWare
Helper I
Helper I

Filtering measure with different behaviours

Hi,

 

I´m trying to get the number of days that someone worked in the field and I´m using the below measure to do that. It´s working when in a matrix with the worked_date field in the Rows and the measure in the values but when i put it in a card it´s showung all the 366 days instead of the applied filters in the measure. Any ideias why?

 

Number of Days worked = CALCULATE(count (Table[worked_date].[Day]),Table[Type]="In the field",Table[status]="Submitted")
1 ACCEPTED SOLUTION
nandic
Memorable Member
Memorable Member

@MigWare ,
Card visual must display same value as total value on crosstab if it is the same measure. It is the same number, just different visualization.
Try to remove .day part here: Table[worked_date].[Day])
I tried to replicate data and put some dummy data, if i add .Day i get 366 both in crosstab and card. If i remove that part i get correct data both in crosstab and card.

Without .Day:
days in field.PNG

With .Day:
days in field day.PNG

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

HI @MigWare,

I think it should be related to power bi auto date/time analysis feature, normally it will auto-generated a hidden calendar table with date fields.
It seems like you're formula reference and calculates on the hidden hierarchy date fields instead of raw table records so it got the wrong result. Please take a look at the following document to know more about that field:

Apply auto date/time in Power BI Desktop 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
nandic
Memorable Member
Memorable Member

@MigWare ,
Card visual must display same value as total value on crosstab if it is the same measure. It is the same number, just different visualization.
Try to remove .day part here: Table[worked_date].[Day])
I tried to replicate data and put some dummy data, if i add .Day i get 366 both in crosstab and card. If i remove that part i get correct data both in crosstab and card.

Without .Day:
days in field.PNG

With .Day:
days in field day.PNG

Fowmy
Super User
Super User

@MigWare 

Try this please:

Number of Days worked = 
CALCULATE(
    COUNTROWS(Table),
    Table[Type]="In the field",
    Table[status]="Submitted"
)

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thanks Fowmy but that´s counting all the in the field and submited and it´s bypassing the date field.

I need to count the date, because user A has 5 visits in day 14 and that only counts has one day in the field, not 5. Hope that clears the info

 

 
 
 

 

 

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.