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

Measure to Group Data

Hi, 

 

I am using a Tabular live connection, and I need to group my stock value into Seasons. 

If it was imported data I would just add a column like below, but how do I get that to work in a measure?

 

IF(MONTH([Last Invoice Date])<7;"SS"&YEAR([Last Invoice Date]);"AW"&year([Last Invoice Date])))

 

Then I would use this measure as columns in a Matrix.

 

2019-11-27 15_52_51-Window.png

 

I hope it makes sense what I am asking for. 

 

Thanks, 

5 REPLIES 5
Greg_Deckler
Super User
Super User

You need to wrap an aggregation function around your columns like MAX, MIN, SUM, FIRSTNONBLANK, LASTNONBLANK, AVERAGE, etc.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi,

 

It does not work. It only returns AW19. Furthermore, I can only add this to values, I need it in Columns of my Matrix. 

 

Season = MAX([Last Invoice Date];IF(MONTH([Last Invoice Date])<7;"SS"&YEAR([Last Invoice Date]);"AW"&year([Last Invoice Date])))

 

I need to create below Matrix. 

2019_11_28_08_02_29_Window.png

 

I do not know if it matters that Last Invoice Date is a measure. 

 

Thanks, 

Hi,

 

Measures are only meant for values.  

 

Your seasons are dimensions.  Assuming you have a Calendar Table, you need a column in there, that shows the Season that each day belongs to.  You can then use that column as a column in your Matrix.   It would work in a similar way to having Quarters in your calendar. 

 

Hope that helps. 

Anonymous
Not applicable

Hi nhoward

 

It is in a live connection so I cannot do that. I need it to be a measure, I cannot add tables. 

 

Maybe it is just not possble. 

 

 

 

I'm fairly sure that you can import from another source, even though most of your tables are live connections. 

 

You do need a master calendar, if you need to group/summarise by periods. 

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.

Top Solution Authors