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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Gopal_PV
Helper II
Helper II

How to create model using Snowflake data tables

Hi Friends,

I have above tables with different other columns due space constraint i have taken main column from the tables.

This is in Snowflake . I have to load these tables or views from snowflake. There are  few conditions need to apply

when chargeType 55 then SoftwareChargeFee

when chargeType 66 then Setupfee   Like condition based charge fees are there.

What is the best way to apply those conditions?

I am building this model with no reference.

Can you please help what is the best way to created model

1. Should go with creating views with business rules and load to PBI?

2. Should i load all the tables to power bi then apply business rules?
3. Should i created individual for individual tables and Load them?
4. What is the best way to create DateTable or Should i created in the individual tables with Hierachy . What best use case to date table.Flow.jpg

Please help me in this design

Which is the best mode  Import/ Direct/ Composite

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Gopal_PV , Import mode is best. 
For this, you need to createa  calculated column in Power Query or DAX, this formula  might not work well with Direct query mode (as column) 

when chargeType 55 then SoftwareChargeFee

when chargeType 66 then Setupfee

 

PQ
NewColumn =
SWITCH(
TRUE(),
TableName[chargeType] = 55, "SoftwareChargeFee",
TableName[chargeType] = 66, "SetupFee",
BLANK()
)

 

 

DAX
= if [chargeType] = 55 then "SoftwareChargeFee"
else if [chargeType] = 66 then "SetupFee"
else null




Others 

Can you please help what is the best way to created model

1. Should go with creating views with business rules and load to PBI?

In Direct query do at source, Import you can have in PBI 

2. Should i load all the tables to power bi then apply business rules?

Yes, in Import mode , prefer import mode 

3. Should i created individual for individual tables and Load them?

You can load views or table. prefer star schema  

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
v-ssriganesh
Community Support
Community Support

Hello @Gopal_PV,

Hope everything’s going great on your end. Just checking in has the issue been resolved, or are you still running into problems? Sharing an update can really help others facing the same thing.

Thank you.

v-ssriganesh
Community Support
Community Support

Hello @Gopal_PV,
Thank you for reaching out to the Microsoft Fabric Forum Community.

I’ve reproduced your model in Power BI Desktop using sample data based on the table structure and logic you shared. Specifically, I applied your condition:

  • When ChargeType = 55, it's labeled as SoftwareChargeFee
  • When ChargeType = 66, it's labeled as SetupFee

The data model includes relationships between Charges_By_Account and Accounts_Account, and I've created a calculated column to classify the charges based on ChargeType.

Best practice start with Import mode for faster development and testing; switch to DirectQuery or Composite later if your data grows or requires real-time updates from Snowflake.

Please find the attached .pbix file for your reference. You can open it in Power BI Desktop to explore the data, model, and visuals.

Thank you, @wardy912 & @amitchandak for sharing valuable insights.

If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.

wardy912
Resolver III
Resolver III

Hi @Gopal_PV 

 

I suggest:

 

  • Snowflake Views (with business rules)
  • Power BI (Import Mode)
  • Power BI Model (Fact + Dimensions + Date Table)

 

Where possible, it's always best to add logic before importing to BI, as this will improve performance of your BI model if it doesn't need to calculate the logic. This also provides a centralised location for collaboration etc.

Use import mode to also get the best performance.

ImportMost commonFast performanceData not real-time
DirectQueryReal-time needs, large datasetsUp-to-date dataSlower performance, limited DAX
CompositeMix of bothFlexibilityComplexity in model design

 

 

If tables are independent, load them separately.
If they are related by keys (e.g., customer ID, transaction ID), create a fact view and dimension views in Snowflake.

Create the date table within Power BI, I always use the following (point it to your most reliable table for a dynamic date)

Date = 
ADDCOLUMNS (
    CALENDAR (
        MIN ( [Date column from existing table] ),
        MAX ( [Date column from existing table] )
    ),
    "MonthNo", MONTH ( [Date] ),
    "MonthName", FORMAT ( [Date], "MMMM" ),
    "MonthYear", FORMAT ( [Date], "MMMM YYYY" ),
    "MonthYearShort", FORMAT ( [Date], "MMM YY" ),
    "MonthYearNo", FORMAT ( [Date], "YYYYMM" ),
    "Quarter", QUARTER ( [Date] ),
    "Year", YEAR ( [Date] ),
    "Day", DAY ( [Date] ),
    "WeekNumber", WEEKNUM ( [Date] ),
    "WeekdayNum", WEEKDAY ( [Date] ),
    "WeekdayName", FORMAT ( [Date], "DDDD" ),
    "PreviousWeek", WEEKNUM ( [Date] ) -1 ,
    "WeekStartDate", ([Date] - WEEKDAY ( [Date] , 1 ) +1),
    "WeekEndDate", ([Date] - WEEKDAY ( [Date] , 1 ) +7),
    "YearMonth", FORMAT ( [Date], "YYYY-M" ),
    "Financial Year", IF (MONTH ([Date]) >= 1 && MONTH ([Date]) <= 12, YEAR ([Date]), YEAR ([Date]) + 1)
)

 

I hope this helps, please give a thumbs up and mark as solved if it does, thanks!

 

amitchandak
Super User
Super User

@Gopal_PV , Import mode is best. 
For this, you need to createa  calculated column in Power Query or DAX, this formula  might not work well with Direct query mode (as column) 

when chargeType 55 then SoftwareChargeFee

when chargeType 66 then Setupfee

 

PQ
NewColumn =
SWITCH(
TRUE(),
TableName[chargeType] = 55, "SoftwareChargeFee",
TableName[chargeType] = 66, "SetupFee",
BLANK()
)

 

 

DAX
= if [chargeType] = 55 then "SoftwareChargeFee"
else if [chargeType] = 66 then "SetupFee"
else null




Others 

Can you please help what is the best way to created model

1. Should go with creating views with business rules and load to PBI?

In Direct query do at source, Import you can have in PBI 

2. Should i load all the tables to power bi then apply business rules?

Yes, in Import mode , prefer import mode 

3. Should i created individual for individual tables and Load them?

You can load views or table. prefer star schema  

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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