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

Client not charged with start date Power Bi

Hi need help to find Active Clients which are not charged in particular week and start date should be before or equal to selected week. i am attaching  data and in data i have mentioned each table on separate sheet, Client sheet is for Client Table and Charge Sheet is for Charges table and  3rd sheet is for expected output.

Charges table only holds those clients which are charged. 

Click to Download file

 

Thanks in Advance

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@Anonymous ,

According to your description, my understanding is that you want to filter the data of the Client which are not charged after the Start Date based on the week.

In this scenario, we can first create a calculated column “Weekn = WEEKNUM(Client[Start Date])” for the client to get the week number of Start Date. Then, we can create a measure like below, this measure will mark these rows which meet the requirement as 1, else as 0.

Measure = var test = CALCULATETABLE(VALUES(Charges[Clinet ID]),FILTER(Charges,Charges[Week]=SELECTEDVALUE(WeekSlicer[Week])))
Return IF(not MIN(Client[Client ID]) in test && MIN(Client[Weekn])<=SELECTEDVALUE(WeekSlicer[Week]),1,0)

After that, we can create a table visual with Client[ClientID] and Client[Name], then drag the above measure to filters of the table visual, set this measure greater than 0.
1.png

 

Please refer to attached pbix file.

Regards,
Lydia

Community Support Team _ Lydia Zhang
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

1 REPLY 1
v-yuezhe-msft
Employee
Employee

@Anonymous ,

According to your description, my understanding is that you want to filter the data of the Client which are not charged after the Start Date based on the week.

In this scenario, we can first create a calculated column “Weekn = WEEKNUM(Client[Start Date])” for the client to get the week number of Start Date. Then, we can create a measure like below, this measure will mark these rows which meet the requirement as 1, else as 0.

Measure = var test = CALCULATETABLE(VALUES(Charges[Clinet ID]),FILTER(Charges,Charges[Week]=SELECTEDVALUE(WeekSlicer[Week])))
Return IF(not MIN(Client[Client ID]) in test && MIN(Client[Weekn])<=SELECTEDVALUE(WeekSlicer[Week]),1,0)

After that, we can create a table visual with Client[ClientID] and Client[Name], then drag the above measure to filters of the table visual, set this measure greater than 0.
1.png

 

Please refer to attached pbix file.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.