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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.