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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Calculate values for each month based on a date/time column

How can I create a measure to calculate 'PPV= (Sum of TRUE COL for June 2020)/(Sum of TRUE COL for June 2020+ Sum of FALSE COL for June 2020)'?.  June 2020 is just an example. The formula needs to be applied to all the date/time and PPV should be different for different months and years. I need to visualize this calculated PPV to show changes every month and year.

Screenshot of the data below.

Shris_D_0-1595440377276.png

 

1 ACCEPTED SOLUTION
nandic
Memorable Member
Memorable Member

Hi @Anonymous ,

This formula is dynamic and should work for all periods selected (one month, several months, several years).

PPV =
var TrueCol = SUM(Sheet1[True Col])
var FalseCol = SUM(Sheet1[False Col])
var Total = TrueCol + FalseCol
RETURN
DIVIDE(TrueCol,Total)
 
true false calc monthly.PNGtrue false calc monthly 2.PNG
Cheers,
Nemanja

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try a measure like this

divide(sum(Table[True Col]),sum(Table[True Col]) + sum(Table[False Col]))

 

For date filter better join to date filter an use that.

https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calendar-1-5-Power/ba-p/1187441

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184


Appreciate your Kudos.

nandic
Memorable Member
Memorable Member

Hi @Anonymous ,

This formula is dynamic and should work for all periods selected (one month, several months, several years).

PPV =
var TrueCol = SUM(Sheet1[True Col])
var FalseCol = SUM(Sheet1[False Col])
var Total = TrueCol + FalseCol
RETURN
DIVIDE(TrueCol,Total)
 
true false calc monthly.PNGtrue false calc monthly 2.PNG
Cheers,
Nemanja

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors