Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello all,
I have a basic matrix table using the date table in the columns and a DAX measure as the values. This DAX measure is dividing two sets of sums from the main data table. My Current Month table is spot on, but the YTD is not calculating the way I need it to.
I need a measure that will add each monthly measured results indivisually, and not the way DAX does it using any YTD measurement.
If this was an excel spreadsheet, i would use Sum (A:E). It looks like the DAX YTD is using the YTD totals first for each measure before dividng the two, like this YTD(Salaries) / YTD (Headcount). I need (Jan (Salaries) / Jan (Headcount)) + (Feb (Salaries) / Feb (Headcount) )...etc
Solved! Go to Solution.
Thank you for the response. I could not quite get it to work. What I ended up doing was adding each month together like this;
02 Lever YTD Force Salaries =
CALCULATE (
[02 Lever Force Salaries],
'Date'[YTD Month] = "Y",
'Date'[Month Number] = 1
) +
CALCULATE (
[02 Lever Force Salaries],
'Date'[YTD Month] = "Y",
'Date'[Month Number] = 2
) +
CALCULATE (
[02 Lever Force Salaries],
'Date'[YTD Month] = "Y",
'Date'[Month Number] = 3
) +....until 12
I then removed the month category out of the column in the Matrix table. I then added a switch filter to change the table to current month, prior month, YTD, etc.
Thank you all for the help 😊
Hi @Higgs11 ,
Could you please provide more details with your desired output and pbix file without privacy information?
How to Get Your Question Answered Quickly
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Higgs11 , if you want grand total to be YTD
If(isinscope(Table[Group]) && not(Isingroup(Date[Date])) , [Wages Rate], divide( CALCULATE(SUM(Table[Salaries]),DATESYTD('Date'[Date],"12/31")), CALCULATE(SUM(Table[Headcount]),DATESYTD('Date'[Date],"12/31")))
refer for isinscope
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
Thank you for the response. I could not quite get it to work. What I ended up doing was adding each month together like this;
02 Lever YTD Force Salaries =
CALCULATE (
[02 Lever Force Salaries],
'Date'[YTD Month] = "Y",
'Date'[Month Number] = 1
) +
CALCULATE (
[02 Lever Force Salaries],
'Date'[YTD Month] = "Y",
'Date'[Month Number] = 2
) +
CALCULATE (
[02 Lever Force Salaries],
'Date'[YTD Month] = "Y",
'Date'[Month Number] = 3
) +....until 12
I then removed the month category out of the column in the Matrix table. I then added a switch filter to change the table to current month, prior month, YTD, etc.
Thank you all for the help 😊
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |