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

Need help with DAX | Creating Dynamic values

HERE IS LINK TO PBIX FILE : https://1drv.ms/u/s!Agarkj-fHbLWjgkn-5Cm64lDbHgU 

 

Hello Community, 

 

I have the data where I want to find the Multi product Users by calendar year and in all given years in one visual.   

My approach is  making hard to  acheive it - I have made two columns that are counting IDs in a calenda year and ALL years,  and based on those columns i Made category either single or Multi User.   

condition -1
Total Products in Calendar Year = CALCULATE( COUNT ('Table'[ID ] ) , ALLEXCEPT( 'Table','Table'[Years] ,'Table'[ID ] ))
Categorgy Products in CAL. Year = IF('Table'[Total Products in Calendar Year] >1, "MULTI" , "SINGLE" )
 Condition- 2
Total Products in ALL Years = CALCULATE( COUNT ('Table'[ID ] ) , ALLEXCEPT('Table' ,'Table'[ID ] ))
Category Products in ALL CAL. Year = IF('Table'[Total Products in ALL Years] >1, "MULTI" , "SINGLE" )
 
I want to write a Measure that can slice based on  single calendar year or multipile calendar years and identify if customer has Single or Multi products in that period .  As of now I am using two visuals (bar charts ) and slicer ( Year) .  I want to use  year slicer with one bar chart. 
 
 
I would really appreciate if you can help me with it. 
 
Many Thanks,
Cha.
 
 
 
 
 
 

 

 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Not sure if this is what you want but I remodeled your table slightly.

Modified = UNION(SELECTCOLUMNS('Table',"ID",'Table'[ID ],"Year",'Table'[Years],"Scope","This year","Count",'Table'[Total Products in Calendar Year],"Category",'Table'[Category Products in CAL. Year]),SELECTCOLUMNS('Table',"ID",'Table'[ID ],"Year",'Table'[Years],"Scope","All years","Count",'Table'[Total Products in ALL Years],"Category",'Table'[Category Products in ALL  CAL. Year]))

 

see attached

 

 

 

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

Not sure if this is what you want but I remodeled your table slightly.

Modified = UNION(SELECTCOLUMNS('Table',"ID",'Table'[ID ],"Year",'Table'[Years],"Scope","This year","Count",'Table'[Total Products in Calendar Year],"Category",'Table'[Category Products in CAL. Year]),SELECTCOLUMNS('Table',"ID",'Table'[ID ],"Year",'Table'[Years],"Scope","All years","Count",'Table'[Total Products in ALL Years],"Category",'Table'[Category Products in ALL  CAL. Year]))

 

see attached

 

 

 

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.