Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi All! Hope doing well,
I have an issue in one personal project im working on.
I have a table called Costs which contains period, brand,team code,country, and values. Then i have another one called Team which contains info about the teams such as employee name, country, brand, team code, region,etc.
Im creating a table that have country, employee name, office, brand, and one measure as columns, now i need another measure that calculates costs over the past 3 months for the brand that the employee is working now, lets say one row is employee A, brand XY, country B, i need a measure to calculate the XY total costs, and another one to calculate XY costs for country B. Is it possible?
Let me know if anything missing.
Thanks!
Solved! Go to Solution.
@Anonymous , You can try using measures
TotalCostsBrand3Months =
VAR CurrentBrand = SELECTEDVALUE(Team[brand])
VAR CurrentDate = MAX(Costs[period])
RETURN
CALCULATE(
SUM(Costs[values]),
Costs[brand] = CurrentBrand,
Costs[period] >= EDATE(CurrentDate, -3)
)
TotalCostsBrandCountry3Months =
VAR CurrentBrand = SELECTEDVALUE(Team[brand])
VAR CurrentCountry = SELECTEDVALUE(Team[country])
VAR CurrentDate = MAX(Costs[period])
RETURN
CALCULATE(
SUM(Costs[values]),
Costs[brand] = CurrentBrand,
Costs[country] = CurrentCountry,
Costs[period] >= EDATE(CurrentDate, -3)
)
Proud to be a Super User! |
|
@Anonymous , You can try using measures
TotalCostsBrand3Months =
VAR CurrentBrand = SELECTEDVALUE(Team[brand])
VAR CurrentDate = MAX(Costs[period])
RETURN
CALCULATE(
SUM(Costs[values]),
Costs[brand] = CurrentBrand,
Costs[period] >= EDATE(CurrentDate, -3)
)
TotalCostsBrandCountry3Months =
VAR CurrentBrand = SELECTEDVALUE(Team[brand])
VAR CurrentCountry = SELECTEDVALUE(Team[country])
VAR CurrentDate = MAX(Costs[period])
RETURN
CALCULATE(
SUM(Costs[values]),
Costs[brand] = CurrentBrand,
Costs[country] = CurrentCountry,
Costs[period] >= EDATE(CurrentDate, -3)
)
Proud to be a Super User! |
|
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 22 | |
| 10 | |
| 10 | |
| 7 | |
| 5 |