AI知识库 @ai521
323 subscribers
22K photos
42 videos
19 files
846 links
@ai521 专注分享最实用的AI内容

🤖 AI教程(新手到进阶)
🧠 AI知识科普(大模型 / 提示词 / 自动化)
📰 AI资讯更新(每日最新AI动态)
📚 AI实战技巧(写作 / 绘画 / 编程 / 赚钱)
🔧 最新AI工具推荐

每天更新AI干货
长期做一个真正有价值的AI频道
Download Telegram
A Stock Certificate from 1941 Taught Me More About AI Than Anyone from OpenAI

Francis Huang May 24, 2026 22 1 2 Share A few weeks ago, I bought a stock certificate from the Boston & Albany Rail Road Company. Certificate number B79362. Twenty-five shares, face value $2,500, issued to Hussey & Co. on May 29th, 1941. It’s a beautiful piece of paper. Olive-green scalloped border, the kind of ornamental engraving that no one does anymore. Across the top, a panoramic scene of Boston Harbor: sailing ships, steamships, a city skyline rising behind them. On the left side, a steam locomotive pulling a line of freight cars. In the center, the Massachusetts state seal, flanked by classical figures. Bottom right, an allegorical scene of Commerce and Industry, a winged figure and a seated goddess surrounded by the tools of trade. Boston and Albany Railroad Company Stock Certificate - 1
949 On the right side, two stamps. “CANCELLED. Jul 23, 1949. State Street Trust Company.” The shares were transferred and voided eight years after they were issued. The company that printed this certificate no longer exists. Neither does the company that acquired it. Or the company that acquired that company. Or the one after that. The railroad it financed is still running. I kept staring at this thing, because the more I learned about the story behind it, the more it started to feel like a message from the past about what’s happening right now. So I went down the rabbit hole. Three weeks later, I came back out, and I think this story is one of the most important things you can read if you’re trying to make sense of the AI moment we’re living through. In 1825, the state of New York opened the Erie Canal. If you’re thinking “a canal, how exciting,” you’re underestimating what this thing did. The Erie Canal connected the Great Lakes to the Atlantic Ocean via the Hudson River, which meant New York City could now move goods to and from the entire American interior for a fraction of the previous cost. Freight rates dropped by 90%. Ninety percent. New York went from one of several competing East Coast ports to the dominant commercial hub in the Western Hemisphere, basically overnight. Boston watched this happen and panicked. Boston had no river connecting it to the interior. Worse, the Berkshire Mountains sat between Boston and Albany like a geological middle finger. You couldn’t build a canal over them. For a few years, it looked like Boston would fade into regional irrelevance while New York ate the continent. Then someone had an idea: what about this new “railroad” technology? Now, railroads in the 1830s were about as proven as large language models were in 2021. A few short lines existed in England. Nobody had built one over a mountain range. The engineering was uncertain, the costs were unknown, and most sensible investors thought the whole concept was speculative nonsense. (Sound familiar?) Boston bet on it anyway. In 1831, the state chartered the Boston & Worcester Railroad. A few years later, the Western Railroad started pushing west toward Albany. By 1842, the full line was open. Boston had its connection to the interior, and it hadn’t needed a river or a canal to get it. The cost was staggering. That one railroad from Worcester to Albany cost $8 million, about the same as the entire Erie Canal. Except the canal was publicly funded by the state of New York. The railroad was financed with private capital, through a financial instrument that most Americans had never used before: This is where the story gets wild. Before railroads, America’s financial system was small and simple. The federal government issued some debt. Banks made loans. A handful of state-chartered companies traded shares on the New York Stock Exchange, which in the 1820s was a few dozen guys meeting under a buttonwood tree. That was it. That was the whole financial system. They needed more capital than any private enterprise had ever required, and they needed it for longer. You can’t build a railroad with a six-month bank loan. You need money for years before a single train generates a dollar of revenue. The time lag between investment and return was enormous. So railroad companies started issuing bonds. Lots of them. A bond said: give us $1,000 now, and we’ll pay you 5% per year for 20 or 30 years, then give your $1,000 back. For investors, this was attractive
because it paid a fixed income and (in theory) returned your principal. For railroads, it was the only way to raise the kind of money they needed at the timescale they needed it. By 1859, American railroads had issued over $1.1 billion in bonds. In 1859 dollars. To put that in perspective: the entire federal budget that year was about $69 million. Railroad debt was sixteen times the federal budget. That bond market transformed the New York Stock Exchange from a sleepy club into the center of global capital markets. Trading volume went from a few hundred transactions a week to hundreds of thousands. And the money wasn’t coming from America alone. British banks underwrote railroad bond offerings. German investors, sitting on savings they couldn’t deploy in their own fragmented economies, bought American railroad debt by the trainload. Capital flowed across the Atlantic for the first time at industrial scale. I want you to sit with this for a second, because I think most people (including me, before I went down this rabbit hole) don’t realize what happened here. The basic financial infrastructure that today’s economy runs on, corporate bonds, public equity markets, institutional underwriting, cross-border capital flows, credit analysis, even the concept of a “balance sheet,” all of it was built to finance railroads. Railroads didn’t just change transportation. They changed money. They were the platform layer underneath everything else. Okay, so railroads rewired capital markets. How big was that rewiring, and how does it compare to what’s happening with AI? Let me try to make these numbers feel real, because they’re the kind of numbers that are so large they slide right off your brain. In the peak years of the 1850s, railroad investment hit about 3% of American GDP. When you count the knock-on spending (land development, equipment, labor camps), the total reached 4-5%. In Britain during Railway Mania in the 1840s, it was even crazier: railway investment surged to 7% of GDP, representing half of all investment in the entire economy. Half. Every other industry in Britain combined was investing the same amount as railways alone. Some scholars put it at 10-20% of private capital formation in peak mania years. No single technology before or since has consumed that much of a nation’s savings. In 2026, five companies (Microsoft, Alphabet, Amazon, Meta, and Oracle) plan to spend between $660 billion and $700 billion on capital expenditure, most of it for AI. That’s up from $162 billion in 2022. A quadrupling in four years. U.S. GDP is roughly $29 trillion, so $700 billion from just five companies is about 2.4% of GDP. To make that tangible: imagine the U.S. economy as a dollar. These five companies are taking about two and a half cents of every dollar produced in America this year and converting it into data centers, chips, and cooling systems. And that’s before you count the chip manufacturers, the energy buildout, the fiber optics, the neocloud startups like CoreWeave and Lambda, and everyone else piling in. Add all of that, and we’re approaching railroad-era levels of capital intensity. McKinsey projects that global AI capex will require $6.7 trillion by 2030 to keep pace with demand. Trillion. With a T. But the comparison that should make you pause is on the revenue side. In 1859, American railroads had $1.1 billion in bonds outstanding, and they were generating revenue from every train that moved. Freight paid by the ton-mile. Passengers
paid by the ticket. The business model was tangible and immediate. You could stand at a station and watch your investment earn money. In 2026, OpenAI’s annual recurring revenue is about $20 billion. Anthropic’s is about $9 billion. Combined, that’s $29 billion. The hyperscalers spending $700 billion on AI infrastructure are generating some AI-related cloud revenue on top of that, but nobody can cleanly separate “AI revenue” from “cloud revenue” in their reporting. Alphabet’s free cash flow is projected to fall nearly 90% this year, from $73 billion to $8 billion. (Read that sentence again. Ninety percent.) The railroad investors of the 1850s could at least count the number of trains running on their tracks. AI investors in 2026 are making a bet that the revenue will come, because the technology is too important for it not to. That bet might be right. It was right for railroads, too, in the long run. In the short run, though, the story got ugly. On September 18, 1873, Jay Cooke & Company went bankrupt. If you haven’t heard of Jay Cooke, think of him as the most trusted name in American finance. During the Civil War, he was the guy who figured out how to sell Union war bonds to ordinary citizens, basically inventing retail financial marketing. He was the federal government’s primary banker. In modern terms, he was a combination of Goldman Sachs, the U.S. Treasury Department, and a patriotic marketing campaign, all rolled into one guy. After the war, Cooke took on the financing for the Northern Pacific Railway, a line that was supposed to connect the Great Lakes to the Pacific coast. Huge project. Very exciting. Investors loved it. The problem was that the Northern Pacific was burning cash faster than it could sell bonds. (Again: sound familiar?) The first transcontinental railroad had already been built, and investors were starting to wonder whether America needed a second one. Bond prices dropped. Cooke’s firm couldn’t meet its obligations. And then everything fell apart at once. The New York Stock Exchange closed for the first time in its history. Ten days of no trading. Eighty-nine of America’s 364 railroad companies went bankrupt. Eighteen thousand businesses failed within two years. But here’s the part that messed me up when I read about it, the part that I think is the most important lesson in this entire story: The devastating part of the 1873 panic wasn’t domestic. German investors, who had been buying American railroad bonds for a decade, got spooked. A real estate bubble in Vienna had just burst. The German economy was opening up new domestic investment opportunities after unification. So German capital started flowing out of American railroads and back to Europe. Read that again. A real estate bubble. In Vienna. Crashed the American railroad industry. Nobody in 1872 was modeling “Viennese real estate bubble bursts → German capital exits American railroad bonds → 20-year depression follows.” The trigger had nothing to do with railroads. The railroads were fine. The routes were good. The trains ran. But the financial system that funded them was entangled with forces on the other side of the ocean, and when those forces shifted, everything crumbled. Twenty years later, it happened again. Between 1893 and 1897, companies owning a third of all American rail mileage went through bankruptcy. This time the cause was domestic: too many companies had built parallel lines competing for the same routes, driving prices below the cost of
service. None of them could generate enough revenue to pay their bond interest. They had built the infrastructure first and assumed the economics would follow. For many of them, it didn’t. (If you’re keeping score at home: blitzscale, check. overbuilt competing infrastructure, check. revenue that couldn’t keep up with capital deployed, check. exogenous shock from an entangled financial system nobody fully understood, check. We’re running this playbook again right now, except with GPUs instead of rail ties.) So the industry is in ruins. A third of American railroads are bankrupt. Investors have been wiped out. Who shows up? Morgan’s playbook was simple and ruthless: buy the bankrupt railroad’s debt for pennies. Foreclose. Create a new company with less leverage. Raise fresh capital. Install management you trust. Put your partners on the board, including the boards of competing railroads, so they stop cutting prices against each other. Between 1893 and 1898, Morgan restructured the Southern Railway, Erie Railroad, Reading Railroad, and Northern Pacific. Other banks followed his model: Kuhn Loeb took Union Pacific, Speyer took B&O. By 1900, Morgan controlled about a sixth of all American railroad track. They called this process “Morganization.” A restructured railroad was said to have been “Morganized.” The term carried a mix of respect and dread, because Morganization worked, but it also meant the original investors, the people who took the risk and funded the construction, were wiped out. The builders and the eventual owners were different groups of people. If you work in finance, you recognize this playbook immediately. Morgan invented what we now call private equity restructuring, distressed debt investing, and activist board governance. He didn’t create these concepts from a textbook. He created them because the railroad industry was a catastrophe and someone had to clean it up, and it turned out that cleaning up catastrophes was the most profitable business of all. I keep thinking about this when I look at AI. The question isn’t just “who builds the best model?” The question is: when the shakeout comes (and if the railroad precedent means anything, a shakeout will come), who will be the Morgan? Who’s sitting on the sidelines with enough capital and enough patience to buy the wreckage and reorganize it? My guess: it won’t be a name you’re reading about in TechCrunch right now. Five companies are spending $700 billion this year to build AI infrastructure. Their combined cash reserves are about $420 billion. These are the most profitable companies in the history of capitalism, and they are burning through their cash at a rate that would have made Jay Cooke uncomfortable. OpenAI has announced over $1.4 trillion in data center deals. The Stargate project alone is targeting $500 billion in infrastructure. Anthropic, xAI, and a constellation of “neocloud” companies (CoreWeave, Nebius, Lambda, Crusoe) are all building as fast as they can. The question everyone keeps asking is: “Is this a bubble?” I’ve spent three weeks with the railroad story now, and I think that’s the wrong question. The railroad investors of the 1860s weren’t wrong about railroads. Railroads changed everything. They connected the continent, enabled industrial agriculture, created the modern corporation, and generated trillions of dollars in economic value over the next century. The investors who bet on railroads were right about the technology. Many of them still lost
everything. They lost because the financial structures built around the technology were fragile. They lost because capital flowed in from places they couldn’t control and flowed out for reasons they couldn’t predict. They lost because competing companies overbuilt capacity and destroyed each other’s pricing. They lost because the gap between “this technology will be transformative” and “this specific company will generate enough cash flow to service its debt” is wide enough to swallow entire fortunes. The railroad boom peaked in 1916, when the U.S. had 254,000 miles of track. Today there are about 140,000 miles. That’s a 40% decline. The technology won. Many of the companies and investors who funded it did not. The thesis was right. The cap table was wrong. Seven Owners, One Railroad The Boston & Albany Railroad survived the Panic of 1873. It survived the Panic of 1893. It survived because its route was irreplaceable (you still can’t build a highway over the Berkshires faster than running a train through them), because its management was disciplined, and because its capital structure wasn’t overextended. In 1900, the Vanderbilt family’s New York Central Railroad was impressed enough to lease B&A for 99 years. The railroad ran under that lease until 1961, when NYC absorbed it fully. Then NYC merged into Penn Central in 1968. Penn Central went bankrupt in 1970, the largest corporate bankruptcy in American history at that time. Then Congress created Conrail. Then CSX bought Conrail’s assets. My certificate was issued in 1941, four decades into that 99-year lease. By then B&A was a subsidiary of New York Central in all but name. Hussey & Co. bought 25 shares for $2,500. Eight years later, State Street Trust Company stamped it “CANCELLED” and transferred the shares. The certificate became a piece of paper. The railroad kept moving freight. I’ll say it plainly: the track from Boston to Albany has been owned by seven different entities in 190 years. Seven. Boston & Worcester. Western Railroad. Boston & Albany. New York Central. Penn Central. Conrail. CSX. Each ownership change created a new set of winners and losers among the people who held the financial instruments. Some shareholders were bought out. Some bondholders were paid in full. Some got pennies. Some got nothing. The trains kept running. The Exit Nobody Planned I don’t know who wins the AI race. Nobody does. If you’d asked someone in 1865 which railroad company would dominate American transportation in 1920, they would have given you a confident answer that was wrong. I’m pretty sure we’re in 1865 right now. But I think the railroad story, if you take it seriously, tells you six things about what happens next. First, the technology will work. That part isn’t in doubt. Railroads worked. AI works. The question was never “will trains move faster than horses?” or “will language models generate useful output?” The answer to both was always yes. The technology question is settled. Everything that follows is a finance question and an ownership question, and those are much harder. Second, the buildout will be larger than anyone currently projects. In 1850, America had 8,879 miles of track. By 1860, it had 30,626. Nobody in 1850 would have believed that number. AI infrastructure spending has quadrupled since 2022 and shows no sign of slowing. McKinsey’s $6.7 trillion projection for 2030 might end up being low. When a technology changes the cost structure of everything, the capital required
to build it out has a way of exceeding every estimate, including the ones that already seemed crazy. Third, the financial system will change in ways we can’t anticipate. Railroads didn’t just use the existing capital markets; they created new ones. Bond markets, equity markets, underwriting syndicates, credit analysis, bankruptcy law, corporate governance, even the concept of the limited liability corporation, all got reshaped or invented to handle railroad finance. AI will do the same. We don’t know what the new financial instruments will look like yet. Maybe compute futures. Maybe revenue-sharing tokens tied to model performance. Maybe something nobody has named yet. The railroad precedent says the instruments themselves will be part of the story. Fourth, a crisis will come, and its trigger will be something nobody is watching right now. In 1873, it was a Viennese real estate bubble. In 1893, it was the cumulative effect of rate wars nobody thought would last. Whatever hits AI won’t be “AI doesn’t work.” It’ll come from some adjacent system that’s quietly entangled with the AI buildout in ways nobody has mapped. A chip supply disruption. A sovereign debt crisis in a country that’s heavily invested in AI infrastructure. An energy bottleneck. Something nobody is talking about at Davos or on the All-In Podcast. The black swan, by definition, is the one you’re not looking for. Fifth, the people who build it and the people who own it long-term will be different. The merchants of Boston who funded the Boston & Worcester Railroad in 1831 were not the Vanderbilt family that controlled it in 1900, and neither of t
Explaining Lineage in DAX

In DAX, lineage is an important concept, and it is vital to understand how to work with and manipulate it. As I did in past articles, I will use DAX queries to explain this concept and its effects. I start with a simple query to get the order count for the product of the brand “Adventure Works”: EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,"Order Count", [Online Order Count] ) ,'Product'[BrandName] = "Adventure Works" ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] This is an extract of the result from the query: This query returns 180 rows. Keep it in mind, as it will be important later on. Next, I will introduce a filter for a specific month and show the lineage’s role
. I will add a filter for April 2026: DEFINE VAR YearMonthFilter = 202604 EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,"Order Count", [Online Order Count] ) ,'Product'[BrandName] = "Adventure Works" ,'Date'[MonthKey] = YearMonthFilter ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] In this case, I define a variable and set the value to 202604. Next, I add it as a filter to the CALCULATETABLE() function. Nothing special so far. In this case, the lineage is not important, as a scalar value sets the filter. But we can set a lineage by using the TREATAS() function: DEFINE VAR YearMonthFilter = TREATAS({ 202604 }, 'Date'[MonthKey]) EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,"Order Count", [Online Order Count] ) ,'Product'[BrandName] = "Adventure Works" ,YearMonthFilter ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] As you can see, the introduction of TREATAS() allows us to pass the variable as a filter. CALCULATETABLE() uses the lineage set by TREATAS() as a filter on the column ‘Date'[MonthKey]. The result doesn’t change, but the query is simpler, as I don’t need to pass the condition as “column equals the filter-value”. In fact, Power BI uses this form all the time when it passes filters set in a report to the semantic model. But it does differently: It defines variables, sets the lineage and adds all filters directly to SUMMARIZECOLUMNS() : DEFINE VAR YearMonthFilter = TREATAS({ 202604 }, 'Date'[MonthKey]) VAR SelectedBrand = TREATAS( { "Adventure Works" }, 'Product'[BrandName]) EVALUATE SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,YearMonthFilter ,SelectedBrand ,"Order Count", [Online Order Count] ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] Clearing the lineage You might encounter situations where you need to clear the lineage. The method for doing it varies depending on whether you have a single or multiple values as a filter. For example, look at the following code, where I use VALUE() to remove the lineage on the previous expression: DEFINE VAR YearMonthFilter = TREATAS({ 202604 }, 'Date'[MonthKey]) VAR YearMonthFilter_cleared = VALUE(YearMonthFilter) EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,"Order Count", [Online Order Count] ) ,'Product'[BrandName] = "Adventure Works" ,YearMonthFilter_cleared ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] This is the error delivered by Power BI: The engine cannot work with the filter in line 71 because it no longer has lineage. It will work in this form: DEFINE VAR YearMonthFilter = TREATAS({ 202604 }, 'Date'[MonthKey]) VAR YearMonthFilter_cleared = VALUE(YearMonthFilter) EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,"Order Count", [Online Order Count] ) ,'Product'[BrandName] = "Adventure Works" ,'Date'[MonthKey] = YearMonthFilter_cleared ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] As you can see here, the query returns the same result as before: Notice the change of the filter argument in line 91. But there is a simpler way of clearing the lineage when working with measures. Look at the following query with the Measure [Order Count
full year], which calculates the order count for the entire year: DEFINE MEASURE 'All Measures'[Order Count full year] = VAR SelYear = TREATAS({ SELECTEDVALUE('Date'[Year]) }, 'Date'[Year]) RETURN CALCULATE([Online Order Count] ,REMOVEFILTERS('Date') ,SelYear ) EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,"Order Count", [Online Order Count] ,"Order Count full year", [Order Count full year] ) ,'Product'[BrandName] = "Adventure Works" ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] This is an extract of the result: Now I add a scalar value to the variable: DEFINE MEASURE 'All Measures'[Order Count full year] = VAR SelYear = TREATAS({ SELECTEDVALUE('Date'[Year]) }, 'Date'[Year]) VAR SelYear_Plus1 = SelYear + 0 RETURN CALCULATE([Online Order Count] ,REMOVEFILTERS('Date') ) EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,"Order Count", [Online Order Count] ,"Order Count full year", [Order Count full year] ) ,'Product'[BrandName] = "Adventure Works" ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] This operation clears the lineage, and the measure no longer works: What I can still do is use an equal filter to get the previous result: DEFINE MEASURE 'All Measures'[Order Count full year] = VAR SelYear = TREATAS({ SELECTEDVALUE('Date'[Year]) }, 'Date'[Year]) VAR SelYear_Plus1 = SelYear + 0 RETURN CALCULATE([Online Order Count] ,REMOVEFILTERS('Date') ,'Date'[Year] = SelYear_Plus1 ) EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,"Order Count", [Online Order Count] ,"Order Count full year", [Order Count full year] ) ,'Product'[BrandName] = "Adventure Works" ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] Now I get the same result as before: And now, let’s use multiple values as a filter. For example, two months: DEFINE VAR YearMonthFilter = TREATAS({ 202604, 202605 }, 'Date'[MonthKey]) EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,"Order Count", [Online Order Count] ) ,'Product'[BrandName] = "Adventure Works" ,YearMonthFilter ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] Here is the result of this query: One way to remove the lineage of a variable with multiple values is to use SUMMARIZECOLUMNS() : DEFINE VAR YearMonthFilter = TREATAS({ 202604, 202605 }, 'Date'[MonthKey]) VAR YearMonthFilter_cleared = SUMMARIZECOLUMNS(YearMonthFilter) EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,"Order Count", [Online Order Count] ) ,'Product'[BrandName] = "Adventure Works" ,YearMonthFilter_cleared ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] Unfortunately, this method removes the filter altogether, and all months are returned in 180 rows (The same number of rows as with the initial query): Technically, the lineage is not cleared because the query still works, but the month filter is removed. But when you try using the variable “YearMonthFilter_cleared” with an IN operator, it doesn’t work anymore: In this context, I tried other functions, like DISTINCT() and VALUES() . While DISTINCT() had no effect, VALUES() has. For example, while this query doesn’t work: DEFINE VAR YearMonthFilter =
TREATAS({ 202604, 202605 }, 'Date'[MonthKey]) VAR YearMonthFilter_cleared = VALUES(YearMonthFilter) EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,"Order Count", [Online Order Count] ) ,'Product'[BrandName] = "Adventure Works" ,YearMonthFilter_cleared ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] Here is the error message: This works when using an IN operator, which indicates that the lineage is cleared when using VALUES(): DEFINE VAR YearMonthFilter = TREATAS({ 202604, 202605 }, 'Date'[MonthKey]) VAR YearMonthFilter_cleared = VALUES(YearMonthFilter) EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[MonthShortName] ,'Date'[MonthKey] ,'Product'[ProductCategoryName] ,"Order Count", [Online Order Count] ) ,'Product'[BrandName] = "Adventure Works" ,'Date'[MonthKey] IN YearMonthFilter ) ORDER BY 'Date'[MonthKey] ,'Product'[ProductCategoryName] Here is the result of the query: The documentation for VALUES() states that this function requires a table or column reference. But this behaviour shows that it depends on how the variable is used in the query. As the variable has a lineage set, VALUES() accept it as a column reference. Next, let’s change how we apply a filter by manipulating the lineage. I want to create a report showing all online orders by country, along with the orders served by stores in each country. For example, I have 68 customer orders from Germany in April 2026. I want to see how many orders have been served by stores in that country, if any. Something like this: I can do it by working with a variable: DEFINE MEASURE 'All Measures'[Orders served from Country] = VAR SelCountry = SELECTEDVALUE('Customer'[RegionCountryName]) RETURN CALCULATE([Online Order Count] ,REMOVEFILTERS(Customer[RegionCountryName]) ,'Store'[RegionCountryName] = SelCountry ) EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[Month] ,'Date'[MonthKey] ,'Customer'[RegionCountryName] ,"Order Count", [Online Order Count] ,"Order Count Country Check", [Order Count Country Check] ) ,'Product'[BrandName] = "Adventure Works" ) ORDER BY 'Date'[Year] ,'Date'[Month] ,'Customer'[RegionCountryName] In this approach, I store the current country in a variable. Then I remove the filter from Customer[RegionCountryName]. And I replace it with a filter on ‘Store'[RegionCountryName]. Or I can do it in this way by using TREATAS(): DEFINE MEASURE 'All Measures'[Orders served from Country] = CALCULATE([Online Order Count] ,REMOVEFILTERS(Customer[RegionCountryName]) ,TREATAS(VALUES('Customer'[RegionCountryName]) ,'Store'[RegionCountryName]) ) EVALUATE CALCULATETABLE( SUMMARIZECOLUMNS('Date'[Year] ,'Date'[Month] ,'Date'[MonthKey] ,'Customer'[RegionCountryName] ,"Order Count", [Online Order Count] ,"Orders served from Country", [Orders served from Country] ) ,'Product'[BrandName] = "Adventure Works" ) ORDER BY 'Date'[Year] ,'Date'[Month] ,'Customer'[RegionCountryName] In this approach, I again remove the filter from Customer[RegionCountryName]. But then I use TREATAS() to switch the filter lineage for the current country to ‘Store'[RegionCountryName]. In this approach, I don’t need a variable; I can directly filter the store table by the current country. This code is much shorter but can be harder to understand for readers who don’t know how TREATAS() works. Since we can create ad hoc tables in DAX, we might run into issues because those tables lack lineage. I
can start writing code about this, but SQLBI already did this, and you can read their article, which is very well explained: You can find it here: The concept of lineage can be hard to understand, even though we use it all the time when working with filters in DAX. Power BI generates code using TREATAS() all the time when it applies report filters. And sometimes it can lead to simpler DAX code when you know how to manipulate it efficiently. This can become vital when I create a table with DAX from existing tables. The table will retain the lineage. This can lead to issues when I try to add relationships to the source tables. Without clearing the lineage, I will encounter an error due to a circular dependency. I encourage you to start experimenting with the concepts shown here and to try to optimise your DAX code. Although “optimise” is the wrong word, as I didn’t notice any performance improvements when using the variants shown. But having DAX code which is shorter and easier to read can be an optimisation by itself. Have fun working with it. A SQLBI article about working with lineage: Like in my previous articles, I use the Contoso sample dataset. You can download the ContosoRetailDW Dataset for free from Microsoft here . The Contoso Data can be used freely under the MIT License, as described in this document . I changed the dataset to shift the data to contemporary dates.
技术保证基金免费开放AI专利分析数据- 阿视亚经济

技术保证基金29日表示,将通过行政安全部公共数据门户,以开放型应用程序编程接口(API)形式免费提供135万件基于人工智能(AI)的专利分析数据。 为支持中小·创投企业的技术创新和AI应用,技术保证基金与行政安全部、知识产权厅、科学技术信息通信部、中小风险企业部合作,将通过企业持有专利分析得出的技
David Sacks's 11th-Hour Plea Led to Trump's Backtrack on AI Executive Order

President Trump postponed signing an order on the dangers posed by artificial intelligence after an adviser warned that industry guardrails could slow down U.S. models in the race against tools from China.