semantic model
2 TopicsModify DAX function in semantic model
Hello community! I hope that someone can help me to resolve this issue that I'm facing. It seems very easy, but I'm not eable to resolve it. Well, the problem is the update of the new year in the power bi reports. The data is located on the sharepoint and can see the reports on the workscpace (Screenshot1) I duplicated the original report S to the C one. And I'm tryinf to download it, because I ca'nt edit the DAX or the functions in the "server" reports. There is no option to export in .pbix format and if I make a save as I cannot open it locally as it is saved in the workspace (screenshot 2). The second problem is that I have used a copy that I have locally to edit the function but I can't replicate the same function in the original report I created a new measurement but I can't configure it as a sum like this: In brief, what I want to do is very easy. I want to correct the function that is incorrectly filtering the year field. But I have not been able to download the report to edit it locally and republish it. If anyone can help me with this or if there is another way to solve it, I will be very grateful to receive your help. Thank you in advance!Solved672Views0likes2CommentsCalculating weekly running sum
Hello, my semantic model has the following structure: In the fact table FACT_REVENUE, for each snapshot_date/departure_date combination there is a revenue value. It has full revenue value only for Sunday snapshot dates (sunday_delta = 'sunday'). Snapshot dates for the rest of the week (sunday_delta = 'delta') are deltas to the previous day. E.g., the revenue for Wednesday, is a sum of revenue for all snapshot_dates since last Sunday to Wednesday (including Wednesday) for a certain departure_date. Dimension tables DIM_SNAPSHOT_CALENDAR and DIM_DEPARTURE_CALENDAR contain all snapshot_dates and all departure_dates, accordingly. I am using the following formula to calculate the weekly running sum of revenue: revenue_running_sum = VAR maximus = MAX ( dim_snapshot_calendar[snapshot_date] ) VAR totalSplit = CALCULATE ( SUM ( fact_revenue[revenue] ), dim_snapshot_calendar[snapshot_date] <= maximus, dim_snapshot_calendar[snapshot_date] >= maximus + 1 - WEEKDAY ( maximus - 7 ) ) RETURN SUMX ( ADDCOLUMNS ( VALUES ( dim_snapshot_calendar[snapshot_date] ), "@Value", 0 ), totalSplit ) First maximum selected snapsh-date is obtained (maximums). The sum is calculated for snapshot_dates <= maximus and snapshot_dates >= last Sunday. When filters on DIM_SNAPSHOT_CALENDAR[snapshot_date] and DIM_DEPARTURE_CALENDAR[departure_date] are applied, the results are correct: However, if I split the result by FACT_REVENUE[days_before_departure] (it is a difference between departure_date and snapshot_date), the results are split into each day since last Sunday: It seems to happen, because when calculating the running sum these snapshot_date/departure_date combinations are selected and when a filter from FACT_REVENUE table is in scope, then it is dispayed as split into those snapshot_date/departure_date combinations. The expected result is: Thus, the sum should be displayed for days_before_departure = 1/31/2024 - 2/7/2024 = -7. Would appreciate any help or suggestions. Thank you1.4KViews0likes4Comments