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

Query regarding Date Hierarchy

Hello All,

I have a query. Pls help me out anyone.

Sushain_Koul_1-1715705478772.png

Whenever I am loading Year, Month (which are calculated columns) fields from Calendar table I am getting data exactly from the date/month from which data is available in power bi. Pls find below screenshot where the minimum date is 2nd dec 2023.

Sushain_Koul_2-1715705616703.png

But when I am using Year, Month as Date Hierarchy it shows me those dates as well which are not available in power bi. Pls see below screenshot.

Sushain_Koul_3-1715705744638.png

Can anyone pls help me with the logic thats running behind this? I am getting confused.

Thanking you guys in advance for your help.

10 REPLIES 10
ExcelMonke
Super User
Super User

Yes, that makes sense because it will assign the "+0" to all dates. One way you can overcome this is to apply a slicer so that it only shows the desired date range. 
An alternative way would be to add Time Intelligence functions to your measure - although this is a bit more complex than a simple slicer. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

I have two questions
1. Why will it assign +0 to all dates? Can u explain me the functionality pls.

2. Adding time intellignece function? Can u just show me a syntax as to how to achieve it in this dax

Campaign Values_New =
IF(FIRSTNONBLANK('Param'[Attributes],1)= "Total Adv Sales",SUMX(campaign_report,campaign_report[directRevenue]+campaign_report[indirectRevenue])+0)

Sure!

  1. Based on your explanation and examples you can think of it as the following. Imagine you have the table where you don't change the blank to zero. It may look like this:
    Year  Month  Value  
    2022Jan 
    2022Feb 
    2022Mar123
    2022Apr456
    Jan and Feb have no values (they are blank/empty), so PowerBI will ignore them. However, once you change the blank to "0", it treats 0 as a "distinct value", rather than a blank. i.e. it is no longer empty. Does this make sense?
  2. There are many to pick from, and I would need to know what your desired outcome is. I'd recommend checking out this page to see which one works best for your use-case: 
    https://learn.microsoft.com/en-us/dax/time-intelligence-functions-dax 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

Thx for your help but I'm still confused. 

Anonymous
Not applicable

Hi @Anonymous ,

Can you please tell me what else you are confused about?

For your first doubt, I think that even if you don't add 0, you can add index columns when you encounter duplicate values and it can help you avoid aggregation.

vyilongmsft_0-1715751225661.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @Anonymous ,

Thanku for your response. Should I just add an index column and not add +0, Will that work perfectly?

Anonymous
Not applicable

Thanku for your explanation. I still have queries. Can u pls check your chatbox or mail as I have send u a text.

ExcelMonke
Super User
Super User

Is there a particular reason why you would like to use the Hierarchy over the Values (option 1 vs. option 2)?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

No reason but I am just curious why they are performing differently. I wanna know why this is occuring @ExcelMonke

Anonymous
Not applicable

Basically I am trying to replace blank with 0 so I am using this dax

Campaign Values_New =
IF(FIRSTNONBLANK('Param'[Attributes],1)= "Total Adv Sales",SUMX(campaign_report,campaign_report[directRevenue]+campaign_report[indirectRevenue])+0)
When I am not using +0 the visual is working perfectly under hierarchy level but when i try to use +0 the hierarchy shows all the months which are not even in power bi.

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.