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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

It makes sense to group by column1, but display column2 ?

I have a Fact Revenue, with 2 dimensions: Customer and Category.

 

I have the below data:

CustomerCategoryRevenue YTDRevenue LYTD
xOldCategory(blank)150
xNewCategory2000(blank)

 

 

(In my pbix I have the below visual). There are just 1 or 2 customers that have changed category; so for that specific case, I see:

 

CategoryRevenue YTDRevenue LYTD
NewCategory2000(blank)

 

 

(This is correct, since the NewCategory has no revenue for the last year).

But, I don't want to see Revenue LYTD as blank; is there a way to display Category, but in fact do a group by Customer?... That way, I would be able to display:

CategoryRevenue YTDRevenue LYTD
NewCategory2000150

 

 

Code is:

Revenue YTD:=CALCULATE ( [Revenue] , DATESYTD('Date'[Date],"31/05") )

Revenue LYTD:=CALCULATE ( [Revenue YTD] , SAMEPERIODLASTYEAR('Date'[Date]) )

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi,  @Anonymous 

Try the following formula:

Revenue LYTD =
VAR _lytd =
    CALCULATE ( [Revenue YTD], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )
RETURN
    IF ( ISBLANK ( _lytd ), [Revenue YTD], _LYTD )

If it doesn't meet your requirement, please share more details.

 

Best Regards,
Community Support Team _ Eason

amitchandak
Super User
Super User

@Anonymous , not very clear what output you want you can try values

 

CALCULATE ( [Revenue] , DATESYTD('Date'[Date],"31/05"), values (Table[Customer] ))

 

Revenue LYTD:=CALCULATE ( [Revenue YTD] , SAMEPERIODLASTYEAR('Date'[Date]), values (Table[Customer] ) )

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

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.