Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I would like to make this formula more generic and taking the value "W29" (or other weeks..) from a column that stores this info. W29 is indeed the table name and is present in column [Reporting Week] as well. Of course, we have many more tables for w28, w27 and so on
Original formula that works but is not mantainable:
SOH = IF([Reporting Week]="W29",CALCULATE(SUM(W29[Entr/bes.]),ALL(W29),W29[Dem/need]="Stock",W29[Article]=earlier('Material/week'[Material]), W29[Date2] <= EARLIER('Material/week'[date])) ...
What I try to do (in excelish terms, using INDIRECT)
SOH = CALCULATE(SUM(INDIRECT(earlier[Reporting Week]&[Entr/bes.]),ALL(INDIRECT(earlier[Reporting Week]),INDIRECT(earlier[Reporting Week]&[Dem/need]="Stock",INDIRECT(earlier[Reporting Week]&[Article]=earlier('Material/week'[Material]), INDIRECT(earlier[Reporting Week]&[Date2] <= EARLIER('Material/week'[date]))
Is there any option to do this in DAX?
Thanks in advance community!
@Pitrus , what are you trying to get here.
In case you are looking for WOW data, refer
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
Hi,
Thanks for the answer.
I am actually looking for referring a table name as a variable. Something like this:
SOH2 =
VAR W=[Reporting Week]
RETURN
CALCULATE(SUM(W[Entr/bes.]),ALL(W),W[Dem/need]="Stock",W[Article]=earlier('Material/week'[Material]))
But it does not work 😞
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
14 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
22 | |
11 | |
10 | |
10 | |
8 |