Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Anonymous
Not applicable

Create Calculated Column based on the result of a measure

Hello!
I need to create a calculated column that places a text depending on whether the condition of a measure is met

This is my table where I must create the Calculated Column:

 

sebasbrs32_0-1675347469670.png

I require that if the Field [MesSK] is equal to the value of the measure [Mes0] I put "Current Month" if the value of the field [MesSK] is equal to the value of the measure [Mes1] I put "Previous Month", if the [MonthSK] field is equal to the value of the measure [Mes2] I put "Same month of the previous year", if the condition is not met I put "Not Applicable"

 

The measures are constructed in this way:

Mes0 := YEAR([Current Date])&FORMAT([Current Date];"mm")
Mes1:=var max_date = VALUE([Month0])
return CALCULATE([Mes0];FILTER(ALLSELECTED('DIM TIME');VALUE('DIM TIME'[mesSK])<max_date))
Mes2:=[Mes0]-100

 

 

sebasbrs32_1-1675347722179.png

 

The calculated column will be used to create a line chart visual in the Legend field on the X axis going to the number of Days

 

sebasbrs32_2-1675348060355.png

 

 

Beforehand thank you very much

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , You should create a measure based on the measure. A calculated column can not take slicer values so no benefit

 

you can have row level measure

 

sumx(Table, [Measure]/[Column1])

 

or need Dynamic segmentation

 

Number - Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

 

Text -Dynamic Segmentation, New/Lost/Retain Customer Count:
Learn Power BI Advance - Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: https://www.youtube.com/watch?v=W4EF1f_k6iY

 

Range Based

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors