cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

Calculated measures

Do you know if it's possible to make such function, that shows calculated measures on rows based on months on columns? I have calculated measures on rows and calendar-hierarchy from tabular model.

I would like to have a function like:

JanuaryMeasure =  if ( month="Jan" , xxx )

FebruaryMeasure =  if ( month="Feb" , xxx )

I can't seem to figure this out 😕 I studied the internet and it seems that function IF works with measures, but what kind of function would work with months?

1 ACCEPTED SOLUTION
Community Support

``````Measure =
SWITCH(MAX('Table'[Month]),"January","xxx","February","yyy","zzz")``````

Calculated column:

``````Calculated column =
SWITCH('Table'[Month],"January","xxx","February","yyy","zzz")``````

Result is as below.

Build a matrix visual and don't forget set show values in row in Format.

If you want to show result as you show above, you may need to build measures for each month.

Best Regards,

Rico Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 REPLIES 5
Community Support

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

Best Regards,

Rico Zhou

New Member

Hi, sorry for my poor question. I will try to be more clear. Does this example help:

 January February Measure 1 (on Jan) xxx Measure 2 (on Feb) yyy

Now I'm looking for a function, that would show these "xxx" and "yyy" on the report based on the month column. So I would have a measure on rows and depending on the month, it will or will not show the amount. What would my functions look like on rows Measure 1 and Measure 2?

Community Support

``````Measure =
SWITCH(MAX('Table'[Month]),"January","xxx","February","yyy","zzz")``````

Calculated column:

``````Calculated column =
SWITCH('Table'[Month],"January","xxx","February","yyy","zzz")``````

Result is as below.

Build a matrix visual and don't forget set show values in row in Format.

If you want to show result as you show above, you may need to build measures for each month.

Best Regards,

Rico Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Super User

@MiraAnniina , In the matrix you have the option to show measure on row

"Show on row" - Switch that on and try. No row. and month on the column

https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/

Super User

I'm not very clear about what you want to do.  Can you please provide some examples of the data and the results you want.

regards

Phil

If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!

Announcements

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors