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
ovonel
Post Prodigy
Post Prodigy

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,  @ovonel 

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

@ovonel , 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] ) )

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.