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
Anonymous
Not applicable

Combination chart - % difference measure - drill down from Y-> M/W/D

Hi Everyone,
 
I am trying to build a combination chart with bar and line. Bar represents sales and the view drills down from Y -> M-> W-> Day. Line should represent percentage difference from previous value based on what view (Year/Month/Week/Day) it is on. So for % difference measure I believe I cant use any TimeIntelligence functions as it needs to change dynamically so it should be something like a Table calculation  (current value - prev value)/Prev value and it should get calculated for each row based on the view it is on (Y/M/W/D). How to achieve this in DAX? Please help! Thanks!
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Since I had to dril down to Week and as well I had to take a differnet approach. I created separate measures for each and created different views and used bookmarks and buttons to switch between them.

View solution in original post

3 REPLIES 3
v-danhe-msft
Employee
Employee

Hi @Anonymous,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered to close this topic?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Since I had to dril down to Week and as well I had to take a differnet approach. I created separate measures for each and created different views and used bookmarks and buttons to switch between them.

v-danhe-msft
Employee
Employee

Hi @Anonymous,

Based on my test, you could refer to below step:

Sample data:

1.PNG

Create below formula:

Measure = var a=MONTH(PREVIOUSMONTH('Table1'[Date]))
var b=IF(CALCULATE(SUM(Table1[Sales]),FILTER(ALL('Table1'),MONTH('Table1'[Date])=a))=BLANK(),BLANK(),CALCULATE(SUM(Table1[Sales]),FILTER(ALL('Table1'),MONTH('Table1'[Date])=a)))
return (CALCULATE(SUM(Table1[Sales]))-b)/b

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.