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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
Super User
Super User

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.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
nandic
Super User
Super User

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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