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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors