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
Avivek
Post Partisan
Post Partisan

New measure needed for month, quarter and year sales.

I have a report which is originally in the below given format;

Avivek_0-1610960014838.png

It has the columns-MTD,QTD and YTD. 

My new requirement is instad of the above given columns it should be as shown below-

Avivek_1-1610960338460.png

We will be having 3 slicers for month, quarter and year. If I select month as Jan, Feb, Mar and April only the Month Unit, Month Sales and Month Mix % will show the value for those months, if I select quarter then only the Quarter columns will change based on the selection and same is for the Year. 
I tried to create measure as-

Month Sales1 = CALCULATE(Sales[Sales Amount],FILTER('Date','Date'[Month Number]))
and same for other columns as well but when I select the different slicers it does not seem to filter as expected.
 
Is there any other way of getting this result?
Appreciate your response.

 

 

 

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @Avivek,

 

Try measure as:

Measure =

var _table=CALCULATETABLE(VALUES('Table'[_subcategory]),FILTER(ALL('Table'),'Table'[category] in FILTERS('Table'[category])))

Return

CALCULATE(MAX('Table (2)'[value]),'Table (2)'[subcategory] in _table)

Here is the output:

v-xulin-mstf_0-1611725403088.png

 

v-xulin-mstf_1-1611725403090.png

 

v-xulin-mstf_2-1611725403092.png

 

v-xulin-mstf_3-1611725403094.png

 

Here is the demo, please try it: New measure needed for month, quarter and year sales.

 

Best Regards,

Link

View solution in original post

2 REPLIES 2
v-xulin-mstf
Community Support
Community Support

Hi @Avivek,

 

Try measure as:

Measure =

var _table=CALCULATETABLE(VALUES('Table'[_subcategory]),FILTER(ALL('Table'),'Table'[category] in FILTERS('Table'[category])))

Return

CALCULATE(MAX('Table (2)'[value]),'Table (2)'[subcategory] in _table)

Here is the output:

v-xulin-mstf_0-1611725403088.png

 

v-xulin-mstf_1-1611725403090.png

 

v-xulin-mstf_2-1611725403092.png

 

v-xulin-mstf_3-1611725403094.png

 

Here is the demo, please try it: New measure needed for month, quarter and year sales.

 

Best Regards,

Link

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.