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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
oliverpenney
Frequent Visitor

Slicer as values not the key

Hi

 

I have a Fact table and a Season table

 

The Season dimension has a Season.LastYearSeasonID (doing a calendar isn't possible I think as i have multiple concurrent seasons)

 

If I add slicer for Fact.SeasonID and then two measures of

 

LastSeason = LOOKUPVALUE (
'DimSeason'[LastYearSeasonID],
'DimSeason'[SeasonID], 'FactLine'[SeasonId]
)

 

and

 

LinesLY =
VAR LY = min('FactLine'[LastSeason])
RETURN CALCULATE (
COUNT('FactLine'[SFID]),
FILTER ( ALL('FactLine'[SeasonID]),'FactLine'[SeasonID]=LY)
)

 

then LinesLY works fine, all good

 

But here's the weird thing, if I change my slicer to DimSeason.SeasonDesc then  LinesLY is blank

 

What's going on here? Any suggestions of things to try are welcome

 

regards

 

ol

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@oliverpenney , not very clear.

if you have a nonstandard calendar like Year and period and Year and Season, then have a separate table for that and Create Rank for Year Season (YYYYSS) //number 

 

Period Rank = RANKX(all('Period'),'Period'[year period],,ASC,Dense)
This Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])))
Last Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])-1))

This Year Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period]=max('Period'[Period]) && 'Period'[Year]=max('Period'[Year])-1))

 

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
oliverpenney
Frequent Visitor

many thanks, that nudged me towards using the suffix field i had in my season dimension and...

 

LinesLY2 = CALCULATE(COUNT('FactLine'[SFID]), FILTER(ALL('DimSeason'),DimSeason[SeasonSuffix]=max(DimSeason[SeasonSuffix]) && DimSeason[seasonyear]=max(DimSeason[seasonyear])-1))
 
seems to be working, though i'll have to check it
 
 

 

 

amitchandak
Super User
Super User

@oliverpenney , not very clear.

if you have a nonstandard calendar like Year and period and Year and Season, then have a separate table for that and Create Rank for Year Season (YYYYSS) //number 

 

Period Rank = RANKX(all('Period'),'Period'[year period],,ASC,Dense)
This Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])))
Last Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])-1))

This Year Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Period'[Period]=max('Period'[Period]) && 'Period'[Year]=max('Period'[Year])-1))

 

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors