Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi Everyone,
Based on store type I need the count of unique outlets at month level ( this was done as it is a direct statement). However they want to implement having multiple months selection. While we select multiple month my categorical column store type will change based on each month data. To overcome this problem planning to implement below logic, where I need your expertise.
Table 1:
Store | Month | Store type |
A | Jan | New |
B | Jan | retain |
C | Jan | retain |
D | Jan | new |
E | Jan | new |
F | Jan | retain |
G | Jan | lapsed |
H | Jan | lapsed |
A | Feb | retain |
B | Feb | lapsed |
C | Feb | retain |
D | Feb | retain |
L | Feb | new |
M | Feb | retain |
N | Feb | lapsed |
T | Feb | retain |
Output format (Table 2: )
E | new |
F | retain |
G | lapsed |
H | lapsed |
L | new |
M | retain |
N | lapsed |
T | retain |
A | retain |
B | lapsed |
C | retain |
D | retain |
Final Output (Table 3: )
Store Type | Count |
lapsed | 4 |
new | 2 |
retain | 6 |
Grand Total | 12 |
Thanks in advance
Regards
Venu
Solved! Go to Solution.
Hi, @venug
Based on your description, you can create the Table 2 and Table 3 as follows.
Table 2 =
SUMMARIZE (
'Table 1',
'Table 1'[Store],
"Store type",
VAR j =
CALCULATE (
MAX ( 'Table 1'[Store type] ),
FILTER ( 'Table 1', 'Table 1'[Month] = "Jan" )
)
VAR k =
CALCULATE (
MAX ( 'Table 1'[Store type] ),
FILTER ( 'Table 1', 'Table 1'[Month] = "Feb" )
)
RETURN
IF (
j = "new"
&& k = "retain",
"Retain",
IF (
j = "new"
&& k = "laspsed",
"Lapsed",
IF (
j = "retain"
&& k = "retain",
"Retain",
IF ( k = "" || ISBLANK ( k ), j, k )
)
)
)
)
Table 3 = SUMMARIZE(
'Table 2',
'Table 2'[Store type],
"Count",
COUNT('Table 2'[Store type])
)
Result:
Table 2:
Table 3:
Best Regards,
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @venug
Based on your description, you can create the Table 2 and Table 3 as follows.
Table 2 =
SUMMARIZE (
'Table 1',
'Table 1'[Store],
"Store type",
VAR j =
CALCULATE (
MAX ( 'Table 1'[Store type] ),
FILTER ( 'Table 1', 'Table 1'[Month] = "Jan" )
)
VAR k =
CALCULATE (
MAX ( 'Table 1'[Store type] ),
FILTER ( 'Table 1', 'Table 1'[Month] = "Feb" )
)
RETURN
IF (
j = "new"
&& k = "retain",
"Retain",
IF (
j = "new"
&& k = "laspsed",
"Lapsed",
IF (
j = "retain"
&& k = "retain",
"Retain",
IF ( k = "" || ISBLANK ( k ), j, k )
)
)
)
)
Table 3 = SUMMARIZE(
'Table 2',
'Table 2'[Store type],
"Count",
COUNT('Table 2'[Store type])
)
Result:
Table 2:
Table 3:
Best Regards,
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.