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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
CheenuSing
Community Champion
Community Champion

How to disable loading of fact data if some dimension values are missing in the new fact data

Hi 

 

I am trying to build a solution as follows in power query.

 

1.  initially I have loaded Sales ( fact data)  and DimCustomer tables.  All CustomerID in Sales(fact data) is available in DimCustomer table.

 

2.  Next day when I loaded the tables I found there are some CustomerID in Sales(fact data) that is not in DimCustomer.

     The reports do not relfect the true data.

 

3. What I want to achieve is

     a)  I would like to check the CustomerID  in new Sales(fact data) is all available in new DimCustomer

    b) if all available then load the new Sales(fact data) else retain the old Sales(fact data ).

 

 

@ImkeF , @OwenAuger  can you help on this.

 

Best Regards

 

CheenuSing

 

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!
4 REPLIES 4
artemus
Employee
Employee

One way to do this is to use dataflows to keep the customer info and use an error statement to fail the refresh if the data isn't consistent. Then your report can consume the dataflow which will have the most recent successful refresh.

Hi @artemus ,

 

Can you please share some links to achieve this in dataflows.

 

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

No, I don't think anyone has tried this yet.

 

To accomplish this, you would

  1. Copy the power query code for the table into dataflows
  2. Reference the query from #1  and do an anti join to get a table of missing customers
  3. Have a query (the only one with enable load) with something like
    if Table.CountRows(MissingCustomers) > 0 then
       error "Missing customers"
    else
      CustomerTable
ImkeF
Super User
Super User

Hi @CheenuSing 

to my knowledge, that's not possible.

As an alternative I'd recommend to dynamically create dummy-entries in your DimCustomer instead.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors