<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MS Fabric Notebook Spark Reading Data from Semantic Model in Data Science</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4600186#M656</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="620192" data-lia-user-login="mybarbie9917_LI" class="lia-mention lia-mention-user"&gt;mybarbie9917_LI&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Mar 2025 10:11:37 GMT</pubDate>
    <dc:creator>v-karpurapud</dc:creator>
    <dc:date>2025-03-07T10:11:37Z</dc:date>
    <item>
      <title>MS Fabric Notebook Spark Reading Data from Semantic Model</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4580910#M642</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I'm using Fabric notebook to read data from PBI semantic model using Spark.&amp;nbsp; The above table only has around 180k rows and but it took 45 minutes to retrieve data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In the past, it didn't take that long - typically just a few minutes. I'm trying to write this data to a Lakehouse destination and it can never finish the job. This table is one of the smallest and I have other bigger tables to work on. I'm using Fabric capacity. Did MS change something last week or is there anything I can do?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 19:34:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4580910#M642</guid>
      <dc:creator>mybarbie9917_LI</dc:creator>
      <dc:date>2025-02-25T19:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: MS Fabric Notebook Spark Reading Data from Semantic Model</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4582625#M643</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="620192" data-lia-user-login="mybarbie9917_LI" class="lia-mention lia-mention-user"&gt;mybarbie9917_LI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if something changed but worth trying the query using sempy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from sempy.fabric import FabricDataFrame&lt;/P&gt;&lt;P&gt;d_person = FabricDataFrame.read_table("Semantic Model", "d_person")&lt;BR /&gt;d_person = d_person[(d_person.on_leave == 'No') &amp;amp;&lt;BR /&gt;(d_person.fte_cw.isin(['FTE', 'CW', 'Other']))]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;`FabricDataFrame` propagates Power BI metadata (relationships, hierarchies) for optimized execution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2025 20:52:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4582625#M643</guid>
      <dc:creator>nilendraFabric</dc:creator>
      <dc:date>2025-02-25T20:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: MS Fabric Notebook Spark Reading Data from Semantic Model</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4587383#M646</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="620192" data-lia-user-login="mybarbie9917_LI" class="lia-mention lia-mention-user"&gt;mybarbie9917_LI&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="913195" data-lia-user-login="nilendraFabric" class="lia-mention lia-mention-user"&gt;nilendraFabric&lt;/a&gt;&amp;nbsp; for your response!&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Thank you for reaching out to the Microsoft Fabric Community. We understand you are experiencing a significant performance drop when querying a Power BI Semantic Model via Spark in Fabric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This issue could be due to Fabric updates, Spark settings, or inefficient query execution. Since it worked in the past but has slowed down recently, it might be caused by Fabric capacity overload. If many users are running workloads, the capacity can be exhausted, slowing everything down.Could you please try the following methods:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL class="lia-list-style-type-disc"&gt;
&lt;LI&gt;Microsoft Fabric upgraded to &lt;SPAN&gt;Runtime 1.3&lt;/SPAN&gt; with &lt;SPAN&gt;Apache Spark 3.5&lt;/SPAN&gt;, bringing major library updates. If you use &lt;SPAN&gt;custom or overridden libraries&lt;/SPAN&gt;, they may cause compatibility issues. &lt;SPAN&gt;Reinstalling libraries&lt;/SPAN&gt; is recommended.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://blog.fabric.microsoft.com/en-GB/blog/microsoft-fabric-january-2025-update/#post-18117-_Toc188889235" target="_blank"&gt;Microsoft Fabric January 2025 update | Microsoft Fabric Blog | Microsoft Fabric&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-engineering/runtime-1-3" target="_blank"&gt;Runtime 1.3 in Fabric - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-engineering/environment-manage-compute" target="_blank"&gt;Compute management in Fabric environments - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL class="lia-list-style-type-disc"&gt;
&lt;LI&gt;Optimize Spark settings by adjusting &lt;SPAN&gt;executor cores, memory, and autoscaling&lt;/SPAN&gt;. For better performance, try &lt;SPAN&gt;disabling autoscaling&lt;/SPAN&gt; and using a &lt;SPAN&gt;fixed number of executors&lt;/SPAN&gt;.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL class="lia-list-style-type-disc"&gt;
&lt;LI&gt;Use monitoring tools like Spark UI to diagnose performance bottlenecks. These tools provide detailed insights into the execution of Spark jobs, helping identify stages that are taking longer than expected.&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-engineering/spark-monitoring-overview" target="_blank"&gt;Apache Spark monitoring overview - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: SegoeUI; font-size: 11.25pt; color: black;"&gt;&lt;SPAN&gt;If the issue persists, it may be h&lt;/SPAN&gt;&lt;SPAN&gt;elpful to open a support ticket with Microsoft Fabric for further investigation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket" target="_blank"&gt;&lt;SPAN&gt;How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;If my response has resolved your query, please mark it as the &lt;STRONG&gt;Accepted Solution&lt;/STRONG&gt; to assist others. Additionally, a '&lt;STRONG&gt;Kudos&lt;/STRONG&gt;' would be appreciated if you found my response helpful.&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;Thank you!&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 07:34:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4587383#M646</guid>
      <dc:creator>v-karpurapud</dc:creator>
      <dc:date>2025-02-27T07:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: MS Fabric Notebook Spark Reading Data from Semantic Model</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4594221#M650</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="620192" data-lia-user-login="mybarbie9917_LI" class="lia-mention lia-mention-user"&gt;mybarbie9917_LI&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 06:20:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4594221#M650</guid>
      <dc:creator>v-karpurapud</dc:creator>
      <dc:date>2025-03-04T06:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: MS Fabric Notebook Spark Reading Data from Semantic Model</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4594875#M653</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="620192" data-lia-user-login="mybarbie9917_LI" class="lia-mention lia-mention-user"&gt;mybarbie9917_LI&lt;/a&gt;&amp;nbsp; Have you tried running DAX query on Semnatic model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try the below. If you have issues on column names tweak in in wrangler.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from pyspark.sql import SparkSession&lt;BR /&gt;import sempy.fabric as fabric&lt;BR /&gt;import re&lt;/P&gt;&lt;P&gt;# Step 2: Initialize Spark Session (Required for PySpark)&lt;BR /&gt;spark = SparkSession.builder.appName("FabricDAXQuery").getOrCreate()&lt;/P&gt;&lt;P&gt;# Ensure the target database exists; create it if it doesn't.&lt;BR /&gt;spark.sql("CREATE DATABASE IF NOT EXISTS --- ANYTHING YOU WANT ---")&lt;/P&gt;&lt;P&gt;# Step 3: List available workspaces&lt;BR /&gt;df_workspaces = fabric.list_workspaces()&lt;/P&gt;&lt;P&gt;# Convert to PySpark DataFrame and display&lt;BR /&gt;df_spark_workspaces = spark.createDataFrame(df_workspaces)&lt;BR /&gt;df_spark_workspaces.show(truncate=False) # Display as a Spark DataFrame&lt;/P&gt;&lt;P&gt;# Step 4: List datasets in the specific workspace&lt;BR /&gt;workspace_name = "----- WORKSPACE NAME ----" # Change this to your workspace name&lt;BR /&gt;df_datasets = fabric.list_datasets(workspace=workspace_name)&lt;/P&gt;&lt;P&gt;# Step 5: Define Dataset and DAX Query&lt;BR /&gt;dataset_name = "---- SEMANTIC MODEL NAME -----" # Ensure this matches exactly&lt;BR /&gt;dax_string = """&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;INSERT HERE YOUR DAX QUERY&lt;/P&gt;&lt;P&gt;"""&lt;/P&gt;&lt;P&gt;# Step 6: Run DAX Query with Correct Argument Name&lt;BR /&gt;df_dax = fabric.evaluate_dax(&lt;BR /&gt;dataset=dataset_name,&lt;BR /&gt;dax_string=dax_string, # FIXED: Corrected argument name from `dax_query` to `dax_string`&lt;BR /&gt;workspace=workspace_name # Specify the correct workspace&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;# Convert result to PySpark DataFrame&lt;BR /&gt;df_spark_dax = spark.createDataFrame(df_dax)&lt;/P&gt;&lt;P&gt;for col_name in df_spark_dax.columns:&lt;BR /&gt;match = re.search(r'\[(.*?)\]', col_name)&lt;BR /&gt;if match:&lt;BR /&gt;# Extract the text within brackets and replace spaces with underscores&lt;BR /&gt;new_col_name = match.group(1).replace(" ", "_")&lt;BR /&gt;df_spark_dax = df_spark_dax.withColumnRenamed(col_name, new_col_name)&lt;/P&gt;&lt;P&gt;# Step 7: Save DataFrame as a Lakehouse table named 'DAX' under the 'LakeHouse_Sales_Report' database.&lt;BR /&gt;df_spark_dax.write.format("delta") \&lt;BR /&gt;.mode("overwrite") \&lt;BR /&gt;.saveAsTable("----DATABASE NAME ----.----TABLE NAME ----")&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 12:22:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4594875#M653</guid>
      <dc:creator>BIstvan</dc:creator>
      <dc:date>2025-03-04T12:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: MS Fabric Notebook Spark Reading Data from Semantic Model</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4600186#M656</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="620192" data-lia-user-login="mybarbie9917_LI" class="lia-mention lia-mention-user"&gt;mybarbie9917_LI&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 10:11:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4600186#M656</guid>
      <dc:creator>v-karpurapud</dc:creator>
      <dc:date>2025-03-07T10:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: MS Fabric Notebook Spark Reading Data from Semantic Model</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4604425#M660</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="620192" data-lia-user-login="mybarbie9917_LI" class="lia-mention lia-mention-user"&gt;mybarbie9917_LI&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please &lt;STRONG&gt;Accept it as a solution&lt;/STRONG&gt; and give it a '&lt;STRONG&gt;Kudos&lt;/STRONG&gt;' so others can find it easily.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 06:02:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4604425#M660</guid>
      <dc:creator>v-karpurapud</dc:creator>
      <dc:date>2025-03-11T06:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: MS Fabric Notebook Spark Reading Data from Semantic Model</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4609361#M664</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="913195" data-lia-user-login="nilendraFabric" class="lia-mention lia-mention-user"&gt;nilendraFabric&lt;/a&gt;! Thanks for your recommendation. I tried your codes but&amp;nbsp;FabricDataFrame Class in Fabric doesn't have the method &amp;lt;&lt;SPAN&gt;FabricDataFrame.read_table&amp;gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I also tried the regular &amp;lt;fabric.read_table&amp;gt; to read the whole table but it keeps running for 15 minutes without result.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import sempy.fabric as fabric
d_person = fabric.read_table(
dataset = "Semantic Model", 
table = "d_person", 
workspace = 'Workspace'
num_rows = 100,
verbose=1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 22:28:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4609361#M664</guid>
      <dc:creator>mybarbie9917_LI</dc:creator>
      <dc:date>2025-03-13T22:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: MS Fabric Notebook Spark Reading Data from Semantic Model</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4609372#M665</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="620192" data-lia-user-login="mybarbie9917_LI" class="lia-mention lia-mention-user"&gt;mybarbie9917_LI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try with different modes :&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;df_onelake = FabricDataFrame.read_table(&lt;BR /&gt;dataset="YourDatasetName",&lt;BR /&gt;table="YourTableName",&lt;BR /&gt;mode='onelake',&lt;BR /&gt;onelake_import_method='spark'&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 22:51:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4609372#M665</guid>
      <dc:creator>nilendraFabric</dc:creator>
      <dc:date>2025-03-13T22:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: MS Fabric Notebook Spark Reading Data from Semantic Model</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4642197#M710</link>
      <description>&lt;P&gt;Which Fabric SKU are you using?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 03:33:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Science/MS-Fabric-Notebook-Spark-Reading-Data-from-Semantic-Model/m-p/4642197#M710</guid>
      <dc:creator>Pradeep_O_S</dc:creator>
      <dc:date>2025-04-08T03:33:10Z</dc:date>
    </item>
  </channel>
</rss>

