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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Jitmondo
Helper III
Helper III

Flagging records that exist in 2 tables based on close date!

Hi All,

 

Scenario

I have 2 tables, where one tells me the expected sales return at the beginning of the month

and one where the actuals sales numbers are stored.

 

I want to see how much of the expected sales were actually made, this means I have to only sum up sales from the actual table that existed in the snapshot table on the 1sst of the month. I have correctly calculated the expected amount from the snapshot table.

 

The next step was to create a flag where I used the Lookup function to flag as 1 or 0 if the id from actuals was present in the snapshot table so I can filter on the records when I use a measure.

 

Desired Outcome

if I have 3 Closed Won sales with an asofdate = 01/01/2023 and a historical date within January 23 I would expect  to see those three sales only in my actual measure.

 

Problem

The above flag can only use id so it will not help me identify the sales in the period. Instead of getting 3 sales like the example above I get other sales too which exist in both tables.

 

Is there a way to flag sales that were expected to closed in month to my actuals table so I only see sales completed that were expected and filter out sales opened and closed in month.

 

Table 1 has Information for sales as of the first day of the month and looks like the below

 

IDAS OF DATEHISTORICAL CLOSE DATE
12501/01/202301/01/2023
51602/01/202302/01/2023
51403/01/202306/12/2022
15304/01/202304/01/2023
23505/01/202305/01/2023
8906/01/202309/02/2023
89407/01/202310/02/2023
54508/01/202311/02/2023
14709/01/202304/12/2022
75410/01/202305/12/2022
45811/01/202306/12/2022

 

Table 2 is a standard actuals table where I have put in a flag using a lookup function. this is the table where I will use a measure for a visual.

 

I have tried to use power query to help but due to the model build it will not allow me to group/merge and I am currently trying to use a virtual table which is not quite there yet.

 

If you kept reading thanks ! hopefully I havent confused you 🙂

 

if you have any ideas on what I could do please let me know,

 

0 REPLIES 0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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