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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Do a Divide function

Hi, 

 

I have a combined table with actual studetns vs Targets. The two fields come from a separate table. Is it possible to do a divide function as a calculated column to see porportion of target achieved? Thanks

 

 actual studentstargets
Uni A1000800
Uni B15001200
Uni C20002500
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can create calculated column as below in the table 'Target data' to get it:

Porportion =
VAR _actual =
    CALCULATE (
        DISTINCTCOUNT ( 'Fact data'[StudentID] ),
        FILTER (
            'Fact data',
            'Fact data'[Uni] = 'Target data'[Uni]
                && 'Fact data'[Commencement_Year] = 'Fact data'[Timeperiod]
        )
    )
RETURN
    DIVIDE ( _actual, 'Target data'[targets] )

vyiruanmsft_0-1736303140775.png

vyiruanmsft_1-1736303199949.png

Best Regards

View solution in original post

4 REPLIES 4
govind_021
Super User
Super User

Hi @Anonymous 
try creating a table with summarizecolumns function , 
SUMMARIZECOLUMNS( ) DAX function.
and then you can use divide

 

Anonymous
Not applicable

the original actual students is a measure as following

CALCULATE(DISTINCTCOUNT('Fact data'[StudentID]),FILTER('Fact data','Fact data'[Timeperiod]= 'Fact data'[Commencement_Year]

I cannot find the field in the function. 

Anonymous
Not applicable

Hi @Anonymous ,

You can create calculated column as below in the table 'Target data' to get it:

Porportion =
VAR _actual =
    CALCULATE (
        DISTINCTCOUNT ( 'Fact data'[StudentID] ),
        FILTER (
            'Fact data',
            'Fact data'[Uni] = 'Target data'[Uni]
                && 'Fact data'[Commencement_Year] = 'Fact data'[Timeperiod]
        )
    )
RETURN
    DIVIDE ( _actual, 'Target data'[targets] )

vyiruanmsft_0-1736303140775.png

vyiruanmsft_1-1736303199949.png

Best Regards

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

It is for creating a measure.

 

Jihwan_Kim_0-1736222364218.png

 

Jihwan_Kim_1-1736222532836.png

# target students: = 
SUM( target[targets] )

 

# actual students: = 
SUM( actual[actual students] )

 

Ratio: = 
DIVIDE( [# actual students:], [# target students:] )

 


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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.