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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
epang0714
Frequent Visitor

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

Hi @epang0714 ,

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

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

View solution in original post

4 REPLIES 4
govind_021
Resolver III
Resolver III

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

 

epang0714
Frequent Visitor

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. 

Hi @epang0714 ,

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors