This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowJuly 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
I am trying to assign a segment code to my customters based on a calculation (in this case average 12 month net adt) over the past 12 months. I created the following measures. It works in the desktop app but when I publish it to the service, it does not have enough memory for the visual. THe switch statement in the desktop app is even a little slow. Ultimately, we need to be able to publish this to the service though.
Solved! Go to Solution.
Thank you again for your help! Here is what I changed and it worked:
Hi @slschmidt ,
Please try to update the formula of measure [Segment L12M Net ADT] as below and check if the related visual can display the data normally in Service.
Segment L12M Net ADT =
VAR enddate =
MAX ( 'Calendar'[Date] )
VAR dailtable =
CALCULATETABLE (
DailyDetailReport,
DATESINPERIOD ( 'Calendar'[Date], enddate, -12, MONTH )
)
VAR summary =
SUMMARIZE ( dailtable, PlayerInfo[PlayerID] )
VAR results =
ADDCOLUMNS (
summary,
"nettheo", CALCULATE ( [Net Theo] ),
"slotsessions", CALCULATE ( [Slot Visits] ),
"l12mnetadt", [nettheo] / [slotsessions],
"Segment",
SWITCH (
TRUE (),
[l12mnetadt] >= 1000, 1,
[l12mnetadt] >= 750, 2,
[l12mnetadt] >= 500, 3,
[l12mnetadt] >= 400, 4,
[l12mnetadt] >= 300, 5,
[l12mnetadt] >= 200, 6,
[l12mnetadt] >= 150, 7,
[l12mnetadt] >= 100, 8,
[l12mnetadt] >= 75, 9,
[l12mnetadt] >= 50, 10,
[l12mnetadt] >= 25, 11,
[l12mnetadt] >= 10, 12,
[l12mnetadt] >= 5, 13,
14
)
)
RETURN
SUMX ( results, [Segment] )
In addition, you can refer the following links to optimize your DAX...
Use Performance Analyzer to examine report element performance (can see and record logs that measure how each of your report elements performs when users interact with them, and which aspects of their performance are most (or least) resource intensive.)
Best Regards
I am sorry. I thought I had it. I used this:
Thank you again for your help! Here is what I changed and it worked:
Thank you so much for responding.
I am getting errors at
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 25 | |
| 23 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 24 | |
| 20 | |
| 20 | |
| 20 | |
| 19 |