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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
vkisa
Helper II
Helper II

Help to create a measure that calculates the upside of the diagonal

Hi all,

I have two date info in my dataset and trying to full fill the upside diagonal of the table.

 

Sample Dataset,

 
YearMonthNumberMonthNameCustomeridDeposit_YearDeposit_Month
20236June295620236
20237July3257202212
202310October3624202310
20231January3258202212
202311November3629202311
20231January326120231
20232February3258202212
20237July2551202210
202311November105220232
202312December360920235
202312December3640202312
20234April3241202210
20236June360920236
20234April326820233
202312December3641202312
20239September285820236
20231January1859202210
20236June2689202210
202311November338120235
20236June330420236
20237July359320236
20233March1779202210
20239September328320238
20239September1799202210
20235May330220235
202310October283620231
20231January731620231
202311November2961202311
20235May2867202210
20238August359120236
20238August361820238
20238August263420235
20237July1044202210
20231January1647202211
20235May360820235
20233March326120231
20234April326520232

 

I can calculate the diagonal values by this measure,

 

 

Count Distinct Customer First Month of Year =
VAR selected_year= SELECTEDVALUE(table1[Year])
VAR selected_month=SELECTEDVALUE(table1[MonthNumber])
RETURN
CALCULATE(
    DISTINCTCOUNT(table1[CustomerID]),
    FILTER(table1, table1[Deposit_Year]=selected_year && table1[Deposit_Month]=selected_month)
)

 

 

But, I need to assign these diagonal values to all next months of the year like below,

 

- Row= table1(Deposit_Year) and table1(Deposit_Month)

 

- Column= table1(Year) and table1(Month)

 

vkisa_0-1706107355769.png

 

 

 

Thank you,

 

Veli

 

2 REPLIES 2
vkisa
Helper II
Helper II

Hi,

 

I have two date info in my dataset and trying to full fill the upside diagonal of the table. 

 

Sample Dataset,

 

YearMonthNumberMonthNameCustomeridDeposit_YearDeposit_Month
20236June295620236
20237July3257202212
202310October3624202310
20231January3258202212
202311November3629202311
20231January326120231
20232February3258202212
20237July2551202210
202311November105220232
202312December360920235
202312December3640202312
20234April3241202210
20236June360920236
20234April326820233
202312December3641202312
20239September285820236
20231January1859202210
20236June2689202210
202311November338120235
20236June330420236
20237July359320236
20233March1779202210
20239September328320238
20239September1799202210
20235May330220235
202310October283620231
20231January731620231
202311November2961202311
20235May2867202210
20238August359120236

 

I can calculate the diagonal values by this measure,

 

Count Distinct Customer First Month of Year =
VAR selected_year= SELECTEDVALUE(table1[Year])
VAR selected_month=SELECTEDVALUE(table1[MonthNumber])
RETURN
CALCULATE(
    DISTINCTCOUNT(table1[CustomerID]),
    FILTER(table1, table[Deposit_Year]=selected_year && table1[Deposit_Month]=selected_month)
)

 

But, I need to assign these diagonal values to all next months of the year like below, 

 

vkisa_0-1706104141692.png

 

Thank you,

 

Veli

 

wdx223_Daniel
Super User
Super User

Count Distinct Customer First Month of Year =
VAR selected_year= SELECTEDVALUE(table1[Year])
VAR selected_month=SELECTEDVALUE(table1[MonthNumber])
RETURN
CALCULATE(
    DISTINCTCOUNT(table1[CustomerID]),
    KEEPFILTERS(FILTER(ALL(table1), table1[Deposit_Year]=selected_year && table1[Deposit_Month]=selected_month))
)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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