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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AllanBerces
Post Prodigy
Post Prodigy

Column to Measure

Hi Good day,

I can anyone pls how to change the calculated column to measure, The highligthed column how to create in measure.

 

AllanBerces_0-1707365891375.png

Thank you

Allan

1 ACCEPTED SOLUTION

Thank you for the help i got the solution by creating Dummy table.

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1707368074659.png

 

Jihwan_Kim_1-1707368644133.png

 

 

WINDOW function (DAX) - DAX | Microsoft Learn

 

Rev sum: = 
SUM( Sales[Revenue] )

 

Cumulate Rev sum: = 
CALCULATE (
    SUM ( Sales[Revenue] ),
    WINDOW (
        1,
        ABS,
        0,
        REL,
        SUMMARIZE ( ALL ( Sales ), Category[Category], 'Calendar'[Date] ),
        ORDERBY ( 'Calendar'[Date], ASC ),
        ,
        PARTITIONBY ( Category[Category] )
    )
)

 

Category Rev total: = 
IF (
    NOT ISBLANK ( [Rev sum:] ),
    CALCULATE ( [Rev sum:], ALL ( 'Calendar'[Date] ) )
)

 

% cumulate rev: = 
VAR _cumulaterev =
    CALCULATE (
        SUM ( Sales[Revenue] ),
        WINDOW (
            1,
            ABS,
            0,
            REL,
            SUMMARIZE ( ALL ( Sales ), Category[Category], 'Calendar'[Date] ),
            ORDERBY ( 'Calendar'[Date], ASC ),
            ,
            PARTITIONBY ( Category[Category] )
        )
    )
VAR _categorytotalrev =
    CALCULATE (
        SUM ( Sales[Revenue] ),
        WINDOW (
            1,
            ABS,
            -1,
            ABS,
            SUMMARIZE ( ALL ( Sales ), Category[Category], 'Calendar'[Date] ),
            ORDERBY ( 'Calendar'[Date], ASC ),
            ,
            PARTITIONBY ( Category[Category] )
        )
    )
RETURN
    DIVIDE ( _cumulaterev, _categorytotalrev )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi Jihwan Kim,

Thank you for your reply, but when i try the dax function show some error. can you pls help me to figure out. 

AllanBerces_0-1707448050619.pngAllanBerces_1-1707448204216.png

 

Hi,

Thank you for your message. I can see that there is many-to-many relationship. If many-to-many relationship is not avoidable, the approach has to be done in a different way.

Please share your sample pbix file, and then I can try to look into it.

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thank you for the help i got the solution by creating Dummy table.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.