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
Mahmoud_nabir
Frequent Visitor

calculate sum with filter between two column

i want to Column Value = (count Number of Rows in Customers Visits  where Customer VisitDay = Planned Visit[VisitDay])

 

filter is only between column and single value but i want to sum filtring by 2 column.

 

 

 

Planned visitPlanned visitCustomer VisitsCustomer Visits

4 REPLIES 4
Mahmoud_nabir
Frequent Visitor

i have 2 Table:-

Planned Visits Details(view customer with planned visit day )

planned Visit Week (total planned visit by week day) (Visitday Column is Text )

 

i want to count the number of visits by week day

 

 

Planned Visit Week 

Visit Day            Planned_visit

Friday                  = count (customerId) where planned Visit Week[VisitDay]= planned visit Week[Visitday]

Saturday             = count (customerId) where planned Visit Week[VisitDay]= planned visit Week[Visitday]

 

Planned Visits DetailsPlanned Visits DetailsPlanned Visits DetailsPlanned Visits Details

 

Planned Visit WeekPlanned Visit Week

Hi @Mahmoud_nabir

 

If you have 0 row for one spefic weekday, for example FRIDAY 0, you could create a new table with a single column including seven weekdays from MONDAY to SUNDAY, then add another column to this weekday column.

new table2 = ADDCOLUMN(new table,"count",CALCULATE(COUNT(Table1[id]),ALLEXCEPT(Table1,Table1[visitday])))

 

Best Regards

Maggie

 

Hi @Mahmoud_nabir

Does your "Planned Visit Week" table only have these two column?

If it is, you could create a new "Planned Visit Week" table with "Planned Visits Details" table.

Create a new table

Table = SUMMARIZE(ALL(Table1),Table1[visitday],"count",CALCULATE(COUNT(Table1[id]),ALLEXCEPT(Table1,Table1[visitday])))

6.png

 

Best Regards

Maggie

v-juanli-msft
Community Support
Community Support

Hi @Mahmoud_nabir

I don't understand what's the meaning of this sentence

"filter is only between column and single value but i want to sum filtring by 2 column"

could you tell me more about this and why you higlight the two columns in the two tables?

 

Best regards

Maggie

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.