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
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
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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.