Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Number of customers by aggregated customer level

Hello


I need a little help with this.
The data contains the interest of the customers, this determines the interest of the customer on a given day. I need to be able to determine at any point in time how many customers had the level at their last assessment.

I have tried to solve it with the following measure.

 
Count_MDM =
VAR Var_Day = CALCULATE ( MAX ( CalendarDIM[Date] ), ALL ( StagesDIM ) )
VAR Var_Stage = CALCULATE ( MAX ( StagesDIM[Stage Level] ), ALL ( CalendarDIM ) )
VAR Var_calc_Table =
CALCULATETABLE (
StagesFact,
ALL ( CalendarDIM ),
ALL ( StagesDIM ),
CalendarDIM[Date] <= Var_Day
)
VAR Var_1 =
SUMMARIZE (
Var_calc_Table,
eu_account_vw[Customer ID],
"stage_now", LASTNONBLANKVALUE ( StagesDIM[Stage Level], MAX ( StagesDIM[Stage Level] ) )
)
VAR Var_2 = FILTER ( Var_1, [stage_now] = Var_Stage )
VAR Var_3 = COUNTX ( Var_2, MAX ( [stage_now] ) )

 

RETURN  Var_3
 
The output is as follows.
Bieli_pmone_0-1623086271345.png

 

The output is almost right, only where the combination of calendar week and the level (stage name) has no new entries, it’s Blank instead of the aggregated value. 

If I make a Calculated Table out of the Measure and return Var_3, it looks about right. So I suspect it is due to the filter context.

 

I look forward to your inputs, thanks in advance.

0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors