cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User I
Super User I

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
Super User III
Super User III

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

Hi @CheenuSing 

to my knowledge, that's not possible.

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

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

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




Microsoft artemus
Microsoft

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

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.

Super User I
Super User I

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

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!
Microsoft artemus
Microsoft

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

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

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors